ReferenceActors

getactors

Returns the Actors currently observed in this game.

Syntax

getactors() -> {Actor}

Also available as

get_actors

Returns

TypeDescription
{Actor}Observed Actor Instances.

Description

Each Actor can own a separate Luau state. The result is a snapshot, not a permanent subscription; Actors can appear or disappear after the call. Use on_actor_added for later observations and run_on_actor to submit source to an eligible Actor.

Example

for _, actor in getactors() do
    print(actor:GetFullName())
end

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