0
0
Unityframework~5 mins

Remote procedure calls in Unity - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a Remote Procedure Call (RPC) in Unity?
An RPC in Unity is a way to call a function on another computer or player over the network, making multiplayer games work smoothly.
Click to reveal answer
beginner
How do you mark a method as an RPC in Unity's networking system?
You mark a method with the [PunRPC] attribute when using Photon, or use [ClientRpc] in Unity's Netcode for GameObjects to indicate it can be called remotely.
Click to reveal answer
intermediate
What is the difference between a ClientRpc and a Command in Unity networking?
A Command is called by a client to run code on the server, while a ClientRpc is called by the server to run code on clients.
Click to reveal answer
intermediate
Why should RPCs be used carefully in multiplayer games?
Because RPCs send data over the network, using too many or large RPCs can cause lag or slow down the game experience.
Click to reveal answer
beginner
Give an example of a simple RPC method in Unity using Photon.
Example:<br>
[PunRPC]
void Jump() {
  // Make the player jump
}
Click to reveal answer
What does an RPC do in Unity multiplayer games?
ACalls a function on another player or server over the network
BSaves game data locally
CDraws graphics on the screen
DHandles user input only
Which attribute is used to mark a method as an RPC in Photon Unity Networking?
A[ClientRpc]
B[PunRPC]
C[Command]
D[Remote]
In Unity's Netcode for GameObjects, what does a ClientRpc do?
ARuns code on clients from the server
BRuns code on the server from clients
CSaves player preferences
DHandles physics calculations
Why should you limit the number of RPC calls in your game?
ARPCs slow down graphics rendering
BRPCs use too much memory locally
CToo many RPCs can cause network lag
DRPCs are not supported on mobile devices
Which of these is NOT a typical use of RPCs in Unity multiplayer?
ASynchronizing player actions
BTriggering animations on other players
CUpdating game state across players
DLoading local game assets
Explain how Remote Procedure Calls help multiplayer games in Unity work.
Think about how players see each other's actions in real time.
You got /3 concepts.
    Describe the difference between ClientRpc and Command in Unity networking.
    Who calls whom in each case?
    You got /3 concepts.