- Home /
How does AssignClientAuthority work?
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?
Answer by MiddleEye · Sep 20, 2017 at 05:35 PM
Did you ever figure it out. I think it is supposed to be on the object to remove and assign authority to it's self.
Your answer
Follow this Question
Related Questions
[UNET] Only spawn certain server objects on local client? 0 Answers
Qos type ReliableFragmented channel, won't fragment our stream 2 Answers
Issue building Android build with com.unity.transport in it 0 Answers
Unity messaging problem - cant send from client to server 1 Answer
Rpc Can't be called on client - Problem with client, works on server 1 Answer