Actors

getcurrentactor

Returns the Actor for the current execution context.

Syntax

getcurrentactor(): Instance | nil
Aliases get_current_actor

Returns

NameTypeDescription
actorInstance | nilActor instance, or nil when none is associated.

Description

Returns the Actor for the current execution context.

Call it without parameters. The function reads the needed context from the current runtime state.

It returns actor (Instance | nil). Use the returns table to separate successful values from nil results and recoverable errors.

Example

Example call with placeholder values.

local result = getcurrentactor()
print(result)