Volt

LuaStateProxy.IsActorState

Whether this state was created for use by Actors.

Syntax

state.IsActorState: boolean

Description

LuaStateProxy.IsActorState is a read-only boolean property that indicates whether the Lua state was created for use by Actors. Returns true for actor states and false for the main game state.

Example

local state = getluastate()
if state.IsActorState then
    print("This is an actor state")
else
    print("This is the game state")
end

Filter Actor States

local states = getactorstates()
local actorStates = {}

for _, state in ipairs(states) do
    if state.IsActorState then
        table.insert(actorStates, state)
        print("Actor state ID:", state.Id)
    end
end

print("Total actor states:", #actorStates)

Conditional Behavior

local state = getluastate()

if state.IsActorState then
    -- Actor-specific logic
    print("Running on actor state")
    local actors = state:GetActors()
    print("Actors in state:", #actors)
else
    -- Game state logic
    print("Running on game state")
end

On this page