Syncing FSM Variables
Alpha Workflow
Treat this as the current recommended setup path, not a final compatibility or production-readiness statement.
Info
Variable syncing is available in beta 83+
Use Network Variable Sync when you want variables on one FSM to replicate across the network.
Best Fit
This component is a good fit when the data belongs to one specific object, such as:
- Health on one enemy
- Ammo on one weapon
- Current state name on one interactable
- A player-specific ready flag
Typical Setup
- Add the FSM to the GameObject you want to synchronize.
- Add
Network Variable Syncto that same GameObject. - Choose which FSM variables should be synchronized.
- Choose the sync direction.
- Choose the sync mode.
- Choose how initial sync should behave.
- Run a host and a client, then confirm the expected machine is driving the value.
Mental Model
Think of Network Variable Sync as answering three questions:
- What values should sync?
- Who is allowed to drive those values?
- When should updates be sent?
Those questions matter more than the exact current implementation details.
Choosing Sync Direction
The sync direction controls where writes are expected to originate from.
Examples:
- Server to clients for authoritative game state
- Owner to others for owner-driven state
- A bidirectional mode for experiments or controlled cases
Alpha Semantics
Bidirectional sync behavior is still considered an area that may evolve. Avoid depending on subtle conflict-resolution behavior until the alpha settles.
Choosing Sync Mode
Choose a sync mode that matches how often the value changes and how important timeliness is.
As a rule of thumb:
- Use lighter update patterns for infrequent changes
- Use more active sync for values players need to see update quickly
If a value changes constantly, first ask whether it truly needs replication or whether it can be derived locally.
Initial Sync
Initial sync decides what a newly connected or newly relevant instance should receive first.
For alpha testing, validate this early with simple values such as:
- A player name
- A score
- A boolean ready flag
Those are easy to inspect and quickly reveal whether the initial state is what you expected.
Keep Early Tests Small
Start by syncing one or two clearly visible variables.
Once that behaves as expected, expand to more complex state.
This is much easier to reason about than trying to debug ten replicated variables at once.