I am using UNet and trying to instantiate a GameObject in a Command function and it works to the point where I need to use OnTriggerEnter2D in that instantiated GameObject and destroy it in another Command function. Then the console says
Trying to send command for object without authority.
and because of it I can’t destroy the GameObject.
I have tried to give authority to the player but it doesn’t work.
My question is how do I instantiate a GameObject on the server and give the right player authority for it.