get_current_actor
Returns the Actor associated with the calling Luau state.
Syntax
get_current_actor() -> Actor?Returns
| Type | Description |
|---|---|
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")
endRelated Functions
isparallel- Check whether the current thread is executing in parallelgetluastate- Get a state proxy for an Actor