Actors
The Actors library provides functions for working with Actors and their Lua states.
Overview
These functions allow you to:
- Get active Actors
- Run code on an Actor
- Create communication channels between actors
- Access related Lua states
- Listen for newly available Actor states
Available Functions
| Function | Description |
|---|---|
create_comm_channel | Create a communication channel |
get_comm_channel | Get an existing communication channel |
get_current_actor | Get the Actor for the current state |
getactors | Get active Actors |
getactorstates | Get all active LuaStateProxy objects |
getluastate | Get LuaStateProxy for actor or script |
getgamestate | Get the default game Lua state |
isparallel | Check if running in parallel |
on_actor_state_created | Event fired when actor state is created |
run_on_actor | Execute code on an actor |
What are Actors?
Actors can run Luau code independently and support parallel execution.
Communication Channels
Communication channels allow actors to send messages to each other. Use create_comm_channel to create a channel and get_comm_channel to retrieve it from another actor.