RPCs and synchronized network variables are two important concepts in Unity multiplayer development.
They solve different problems:
- RPCs can be used to communicate that an action or event should happen.
- Network variables can represent synchronized values that clients need to observe.
For multiplayer board games, understanding the difference helps developers avoid unnecessary network traffic and keep game logic organized.
- What Is an RPC?
- What Is a Network Variable?
- RPC vs Network Variable
- Client to Server Communication
- Server to Client Communication
- Example: Rolling a Dice
- Example: Synchronizing Player Position
- Choosing Between RPCs and Variables
- Avoiding Unnecessary Network Traffic
- Authority and Validation
- Common Mistakes
- Related Documentation
RPC stands for Remote Procedure Call.
In multiplayer development, an RPC is a mechanism for requesting that a method or action be executed on another network participant.
A conceptual flow looks like:
Client
│
│ RPC Request
▼
Server
│
│ Execute / Validate
▼
Game Logic