Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Unity Multiplayer SyncVar causes Error

Discussion in 'Multiplayer' started by Mabenan, Jun 21, 2015.

  1. Mabenan

    Mabenan

    Joined:
    Feb 7, 2014
    Posts:
    132
    Hi guys,

    I have tried around a little bit with Unet but i can't get SyncVar working. (see atached Error)

    Code (CSharp):
    1.  
    2. public class Player : NetworkBehaviour {
    3.  
    4.     [SyncVar]
    5.     public string pname = "";
    6.  
    7.     public void SetName(string newName)
    8.     {
    9.         pname = newName;
    10.     }
    11. }
    thats my NetworkBehaviour. SetName is only Called from the Server after the Player is created.

    Hope you can help.
    Thanks in advance.
    Mabenan
     

    Attached Files:

  2. Mabenan

    Mabenan

    Joined:
    Feb 7, 2014
    Posts:
    132
    Ok I've tried around a little bit and the networkAnimator causes the Problem