Lua LocalPlayer GetAliveCompanions

Details
Returns all alive companions for the local player as a LuaUnit objects.

NOTE: This function returns a C# List<?> that has not been marshalled. It is recommended that you marshal the results into a Lua table using the provided toTable function, as shown in the example below.

NOTE: It is possible for a pet returned by this function to no longer be valid. If needed, you should verify that by checking IsValid.

Example
-- Get the companions for the player. local companions = toTable(Me.GetAliveCompanions);

-- Loop through each companion and print it to the log! for k, v in pairs(companions) do Info("Companion: " .. v.DisplayName); end