Syntax
getcurrentactor(): Instance | nilAliases
get_current_actorReturns
| Name | Type | Description |
|---|---|---|
actor | Instance | nil | Actor 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)