Best Practices
Tips for networked state machines
Follow these guidelines for optimal multiplayer state machine performance.
Minimize Network Traffic
Only sync nodes that need to affect all clients
Use Run on Owner for local-only logic (UI, sounds)
Batch related actions in single nodes
Good Example
Actions Node [RPC to All]
โโ Action: Damage Enemy
โโ Action: Update Health Bar
โโ Action: Play Hit EffectBad Example
Actions Node [RPC to All] โ Damage Enemy
Actions Node [RPC to All] โ Update Health Bar
Actions Node [RPC to All] โ Play Hit EffectThe bad example sends 3 RPCs instead of 1.
Handle Late Joins
State machines automatically sync state to late joiners
Ensure Start nodes handle mid-game joins gracefully
Use variables to store persistent state
Avoid Non-Deterministic Logic
Networked state machines should produce consistent results:
Random.value
Seeded random with synced seed
Time.time
Network time or synced timestamps
Local-only conditions
Synced variables
Separate Concerns
Keep local and networked logic separated:
Use Variables for State
Store important state in synced variables rather than relying on node execution:
Variables persist across late joins
Variables can be inspected for debugging
Variables sync automatically when configured
Test Early and Often
Test with multiple clients from the start
Use ParrelSync or multiple builds
Test late-join scenarios
Test with simulated latency
Last updated
Was this helpful?