Complete the code to declare a NetworkVariable of type int.
public NetworkVariable<int> playerScore = new NetworkVariable<[1]>();The NetworkVariable is declared with the type int to hold integer values like player scores.
Complete the code to check if the current instance is the server.
if (NetworkManager.Singleton.[1]) { // Server-only logic here }
IsClient which checks for client role instead.IsServer is true when the current instance is running as the server.
Fix the error in the method to send a server RPC.
[ServerRpc]
public void SendMessageToServer(string message) {
[1]
}The statement must end with a semicolon to be syntactically correct in C#.
Fill both blanks to create a NetworkObject and spawn it on the server.
var obj = Instantiate([1]); obj.[2]();
Instantiate the prefab and call Spawn() to make it a networked object on the server.
Fill all three blanks to create a NetworkVariable, set its value, and read it.
NetworkVariable<int> score = new NetworkVariable<int>(); score.[1] = 10; int currentScore = score.[2]; Debug.Log([3]);
Use the Value property to set and get the NetworkVariable's value. Then log the currentScore variable.
