Why the SyncVar won't update

Hello, I have my scripts set up so that one GameObject will send a message to the enemy player. The script that is called in the enemy player is networked (using UnityEngine.Network; using NetworkBehaviour). When the host sends the message to the script the SyncVar updates (I think) because the hook is called but when the client does so, the hook is not called. Any ideas why this may be? Thanks

  • Jonathan Gonzalez(jgonzalez) replied

    Usually when that happens you'll probably see a message in the console. I recommend playing the game as the client in the editor while hosting in a stand alone game. That'll show you any errors or warnings that the client game would have. More than likely what you'll see is that you're trying to call a server method without authority. Make sure that players have authority to do so. Also check that any updated SyncVar values are being changed on the host. If it's not being changed on the clients but it is on the host then you know it's a client issue. If it's not being changed anywhere then you need to further look at why.