Quantcast
Channel: Multiplayer
Viewing all articles
Browse latest Browse all 16796

SyncVar Hooks not receiving updated values

$
0
0
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.

Code (CSharp):
  1. public class Vitals : NetworkBehaviour
  2. {
  3.   [SyncVar(hook = "OnHealthChange")] public float Health;
  4.   [SyncVar(hook = "OnThirstChange")] public float Thirst;...
SyncVar Hooks not receiving updated values

Viewing all articles
Browse latest Browse all 16796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>