getactorstates
Returns LuaStateProxy objects for active Actors.
Syntax
getactorstates() -> {LuaStateProxy}Returns
| Type | Description |
|---|---|
{LuaStateProxy} | Array of Actor Lua states |
Description
Use getgamestate() when you need the game state instead.
Example
local states = getactorstates()
print("Total Lua states:", #states)
for i, state in ipairs(states) do
print(i, "State ID:", state.Id, "Is Actor:", state.IsActorState)
endFilter Actor States
local states = getactorstates()
local actorStates = {}
for _, state in ipairs(states) do
if state.IsActorState then
table.insert(actorStates, state)
end
end
print("Actor states:", #actorStates)Related Functions
getluastate- Get LuaStateProxy for a specific actor or scriptgetgamestate- Get the default game Lua stategetactors- Get all Actor instances