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

FunctionDescription
create_comm_channelCreate a communication channel
get_comm_channelGet an existing communication channel
get_current_actorGet the Actor for the current state
getactorsGet active Actors
getactorstatesGet all active LuaStateProxy objects
getluastateGet LuaStateProxy for actor or script
getgamestateGet the default game Lua state
isparallelCheck if running in parallel
on_actor_state_createdEvent fired when actor state is created
run_on_actorExecute 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.