get_current_actor Synchronous

  • getcurrentactor

Find the Actor associated with the current executing thread. Use it inside Actor code to identify its owner without passing the Instance separately.

Syntax
Luau
get_current_actor() -> Actor?

Parameters

This function takes no arguments.

Returns

Actor?

The current Actor Instance, or nil when the thread is outside an Actor.

Example

Example
Luau
local actor = get_current_actor()
if actor then
    print("Running in:", actor:GetFullName())
else
    print("No current Actor")
end
Kawaii documentation