Unity / Mirror second player has no authority on PlayerController

Viewed 155

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.
}

Second Player Network Information

1 Answers

Turns out, that my player controller script was a singleton and I did not know, that every clients player controller has to be in every other clients scene...

Related