SyncVar problem

I scripted this script in c#:

using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using UnityEngine.Networking;

public class GetText : NetworkBehaviour {

    [SyncVar]
    public string Live;

    [SerializeField]
    Text abc;

    void Start () {
   
    }

    void Update () {

        abc = GetComponent <Text> ();
        abc.text = Live;
    }
}

I attached this script to a text object in the scene.
But the string variable doesnt sync.
Can someone help me.

Thanks in advance.

  1. A gameObject with a NetworkBehavior must also have a NetworkIdentity component.
  2. Disable Local Authority on the NetworkIdentity.
  3. Make sure you actually give the Live a value somewhere in the code on the server, and not on the client.
  4. Register the prefab of your gameObject by adding it to the NetworkManager’s list of spawnable prefabs.