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

Unity 5.2 SyncVar hook only gets called on host.

$
0
0
Basically i have a script that edits the location of a box, this box updates from host to client so they both see the box move, but on client to host it has no effect, on debuging the SyncVar Hook i made never calles the function, here is how its setup..

class ObjectUpdatePossition, is attached to the object that im trying to move.

Code (CSharp):
  1.  public class ObjectUpdatePossition : NetworkBehaviour
  2. {
  3.      [SyncVar(hook = "value_changed")]
  4.      private Vector3 syncpos;
  5.    
  6.  
  7.      void...
Unity 5.2 SyncVar hook only gets called on host.

Viewing all articles
Browse latest Browse all 16796

Trending Articles



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