Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Networking SyncVar properties in parent and child classes.

Discussion in '5.1 Beta' started by noise256, May 22, 2015.

  1. noise256

    noise256

    Joined:
    Apr 7, 2013
    Posts:
    22
    Not sure what to make of this but when I put a SyncVar variable in a child class of a class that already has a SyncVar is appears to break the syncing of variable in the parent. In my case, as follows, health would not be synced if I declared shipId in the child class.

    Code (CSharp):
    1. public class NetworkedPhysical : NetworkBehaviour {
    2.     [SyncVar]
    3.     public int health;
    4.  
    5.     //...
    6. }
    Code (CSharp):
    1. public class PlayerManager : NetworkedPhysical {
    2.     [SyncVar]
    3.     public NetworkInstanceId shipId;
    4.  
    5.     //...
    6. }
     
  2. seanr

    seanr

    Unity Technologies

    Joined:
    Sep 22, 2014
    Posts:
    669
    This is currently not supported by the HLAPI.
     
    Zullar likes this.