Question by
TheBoogieKing · Oct 08, 2019 at 12:28 PM ·
networkingsetactivecommandclients
How to sync SetActive over unity networking with a non player object?
I am trying to port my FPS game over to multiplayer (UNET) from single player. I have pickup-able items for the player that get SetActive true and false and when the player picks it up. I have a script using onDisable and onEnable on the objects and I want the object to tell all other clients to SetActive to the same as it. I have it setup where the object calls a script on the player that uses [Command] and [ClientRPC] to hide all of the object on the other clients. It works if the server picks up the item, but when the client picks up the item it stays active and I get the "Trying to send command for object without authority" message. If anyone could help that would be greatly appreciated; I have spent way too long trying to fix this!
Comment