Examples
Practical multiplayer state machine examples
Real-world examples of networked state machines.
Networked Door
A door that any player can interact with, synced across all clients:
Trigger: On Interact [Run on Owner]
โโ Action: Toggle Door State [RPC to All]
โโ True โ Action: Open Door Animation [Run on All]
โโ False โ Action: Close Door Animation [Run on All]How It Works
Only the interacting player's client detects the interaction
The toggle state is sent to all clients via RPC
All clients play the appropriate animation
Synced Health Pickup
A pickup that only the server validates, preventing cheating:
Trigger: On Trigger Enter [Run on Master]
โโ Condition: Is Player? [Run on Master]
โโ True โ Actions [RPC to All]:
โโ Add Health
โโ Play Sound
โโ Destroy PickupHow It Works
Only the server checks for collisions
Server validates it's a player
Server sends RPC to give health and destroy pickup
All clients see the same result
Multiplayer Chest
A chest that can only be opened once, with loot visible to all:
How It Works
Any player can interact
Server checks if already opened (prevents race condition)
State change and effects sync to all clients
Player Ability
A player ability with local effects and networked damage:
How It Works
Only the casting player sees their own VFX/sound
Damage is synced to all clients
All clients see the hit effect on the target
Game Manager
A server-authoritative game flow controller:
How It Works
Server controls all game flow decisions
State changes are broadcast to all clients
Clients update their UI based on RPCs received
Last updated
Was this helpful?