Lua GetDynamicObjects

GetDynamicObjects
Returns all dynamic objects currently loaded by the client as LuaGameObject 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 dynamic object returned by this function to no longer be valid. If needed, you should verify that by checking IsValid.

Example
-- The result of GetDynamicObjects is marshalled to Lua using our toTable function. local objects = toTable(GetDynamicObjects);

-- Loop all objects and print their names to the log. for k, v in pairs(objects) do Info("Object at index " .. k .. " is named " .. v.Name); end