I am new to Mirror and facing this problem: In my board game I want to create some tokens when a client connects. This works fine with the first one, but when the second client tries to register, it says "Trying to send command for object without authority. System.Void NetworkController::RegisterPlayer()". The API says, that auto spawned players are granted authority also automatically.
Thanks for your help!
public override void OnStartClient()
{
base.OnStartClient();
if (hasAuthority)
NetworkClient.connection.identity.GetComponent<NetworkController>().CmdRegisterPlayer();
}
[Command]
public void CmdRegisterPlayer()
{
// do sth.
}