Lua GetGameObjects

GetGameObjects
Returns all valid game 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 game object returned by this function to no longer be valid. If needed, you should verify that by checking IsValid.

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

-- 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