-
Notifications
You must be signed in to change notification settings - Fork 0
FAQ
Common questions about the current RBXStateMachine runtime, with answers grounded in the source code rather than older snippets.
Server:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Orchestrator = require(ReplicatedStorage:WaitForChild("Orchestrator"))
Orchestrator:RegisterComponents()Client:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Orchestrator = require(ReplicatedStorage:WaitForChild("Orchestrator", 30))
Orchestrator:RegisterComponents()In this repository's default Rojo project, the framework module is ReplicatedStorage.Orchestrator.
Not in this repo's current default mapping. The source-of-truth path is:
ReplicatedStorage.Orchestrator
Not in the normal bootstrap path. Orchestrator:RegisterComponents() initializes the scheduler and calls:
Orchestrator.Scheduler:Start()It also schedules GlobalStateMachineHeartbeat after disabling the base FSM internal loop.
No. The current public usage is simply:
Orchestrator:RegisterComponents()Recommended:
ReplicatedStorage/
βββ Entity/
βββ StateMachine/
But the current factory actually scans all game descendants for supported alias names.
Yes, as long as the folder name matches a supported alias:
- Entity side:
Entity,Entities - FSM side:
StateMachine,StateMachines,SM,FSM
The location can vary; the folder name must match.
No. The factory requires and compiles discovered ModuleScripts automatically.
A table definition describing the class.
For entities, that usually includes Name, Schema, and methods such as GetContext / ApplyChanges.
For FSMs, that usually includes Name, ValidStates, InitialState, and RegisterStates.
Yes, by default. The current factory auto-starts the new machine unless you pass:
AutoStart = falseWhen you intentionally created the FSM with AutoStart = false, or when you instantiated a child/new machine outside the usual factory helpers and need to control the exact first state yourself.
Q: What's the difference between ScheduleTransition, Timeout, Transitions[].Condition, and WaitSpan?
-
ScheduleTransitionβ one-shot delayed exit from the current state -
Timeout+OnTimeoutβ state-owned deadline -
Transitions[].Conditionβ reactive branching checked during_Update -
WaitSpanβ delayed same-state re-entry / polling pattern
Check, in order:
- did the machine actually get created?
- is
GlobalStateMachineHeartbeatrunning? - is the current state legal and registered?
- did the state schedule or trigger an exit?
- is the bug actually in the wrong context (client vs server)?
ServiceManager FSM, TASKS, and CONSOLE are the fastest places to verify those.
It is most useful for delayed same-state re-entry/self-loop patterns. Use ScheduleTransition() instead for straightforward fixed exits.
The current BaseEntity fast-fails when:
- the entity is invalid/destroyed
- the entity is locked by another caller
- there are no pending changes
- the entity is not mutable
Declare:
Mutable = truein the entity definition if the entity is expected to commit staged changes via UpdateEntity().
- Schema β authoritative, validated game state
-
Context β runtime references like
Instance,Humanoid,Animator, or other non-replicated helpers
Check all of these:
- field marked
Replicate = true - server actually called
UpdateEntity() -
ApplyChanges()handles the field - versioning is not stale on the client
- update is visible in ServiceManager
NETWORK/ENTITY
On the client. You start it from a client script with:
Orchestrator:StartServiceManager()Yes. Switch the dashboard to server context. The client fetches server snapshots and polls periodically.
The current dashboard exposes these root tabs:
TASKSFSMENTITYNETWORKDATASTOREINSIGHTSCONSOLELOGSPROFILER
Current built-ins include:
helpclearechoversionmodetasksfsmentitiesnetworkdsperfswitch
Current source-of-truth automated tests live in:
FSM/Orchestrator/ServiceManager/Tests
with RunAllTests.luau, TestRunner.luau, and Specs/*.spec.luau.
Yes, but read them as examples, not perfect production templates.
Important current-runtime notes:
- add
Mutable = trueto example entities that commit withUpdateEntity() - manual
:Start()afterCreateStateMachine()is often redundant now because auto-start is the default
Use:
test/main.server.luautest/Client.client.luau
Those boot the framework and ServiceManager with almost no extra setup.
Core/Settings.luau currently sets:
FrameBudget = 0.015In the current factory logic, it behaves like updates per second because the send interval is calculated as 1 / RateLimit.
Usually no. Treat it as a development/staging tool unless you have a very deliberate reason to expose it.
These three usually matter most:
- minimize replicated fields
- choose FSM priorities intentionally
- connect
Failedhandlers and log real error boundaries
Quick Links: Home Β· Quick Start Β· API Reference Β· Architecture Β· Examples Β· Glossary
Copyright: Β© 2026 RBXStateMachine contributors Β· Repository Β· License information