get_current_actor

Returns the Actor associated with the calling Luau state.

Syntax

get_current_actor() -> Actor?

Returns

TypeDescription
Actor?The current state's Actor, or nil in the main game state

Example

local actor = get_current_actor()

if actor then
    print("Running in Actor:", actor:GetFullName())
else
    print("Running in the main game state")
end
  • isparallel - Check whether the current thread is executing in parallel
  • getluastate - Get a state proxy for an Actor