The following code is attached to the player object which has a Network Identity and is marked as Local Player Authority. The host's Thirst and Hunger values are updated correctly, but on the client the values are always what was set in the prefab.
Does anyone have an idea of what I'm doing wrong? Thanks in advance.
SyncVar Hooks not receiving updated values
Does anyone have an idea of what I'm doing wrong? Thanks in advance.
Code (CSharp):
- public class Vitals : NetworkBehaviour
- {
- [SyncVar(hook = "OnHealthChange")] public float Health;
- [SyncVar(hook = "OnThirstChange")] public float Thirst;...