I’m working on a game in which Player 1 should be able to control the camera and Player 2 a character.
Player 1 is the Server, Player 2 is a Client connecting to the server.
I’m trying to set the Authority for my character object in my NetworkManager:
public class NetworkMan : NetworkManager {
int numcon = 0;
public override void OnServerConnect(NetworkConnection conn)
{
numcon++;
if (numcon == 2) {
GameObject.Find ("character").GetComponent<NetworkIdentity> ().AssignClientAuthority (conn);
}
}
}
But i still get “Trying to send command for Object without authority” on client side.
What am i doing wrong?