Hi, I cannot get hasAuthority to work no matter what. I instantiate a GameObject ands spawn it with SpawnWithClientAuthority and no instance of the game has hasAuthority true, or GetComponent().hasAuthority…
Can anyone make it work?
Hi, I cannot get hasAuthority to work no matter what. I instantiate a GameObject ands spawn it with SpawnWithClientAuthority and no instance of the game has hasAuthority true, or GetComponent().hasAuthority…
Can anyone make it work?
Guess this is why Unet hasn’t been everybody’s first choice: I see questions all over the forum, and none has been answered…
I just made a new game, you don’t have to do anything fancy, just spawn a gameobject on a server and the server doesn’t even have authority of that object. The networkIdentitys LocalPlayerAuthority flag is on of course because I need other ones to have authority on their clients
SOLVED!!!
So it’s not exactly a bug but good to know, OnStartClient is just too early for Unity even if the object is spawned with SpawnWithClientAuthority it takes a little bit before it recognises it, the Update function will say HasAuthority is true right away but OnStartClient will not.
OnStartAuthority() is called when authority is actived for an object.