ReferenceActors

state:GetActors

Lists observed Actors associated with this state proxy.

Syntax

state:GetActors() -> {Actor}

Returns

TypeDescription
{Actor}Observed Actors belonging to the state.

Description

An Actor-state proxy lists Actors associated with its state. The main game-state proxy returns an empty list. The returned array is a snapshot. Removed Actors and expired state proxies must not be used as permanent execution targets.

Example

local state = getgamestate()
for _, actor in state:GetActors() do
    print(actor:GetFullName())
end

These are Game executor contracts. Check build requirements and session lifetimes before using them.