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.

Hi. If you’re trying to change the variable from the editor, it won’t be synced. This is because it won’t be set to dirty and updated. You would have to manually set it dirty with SetDirtyBit(). Here’s more information: UNet SyncVar not working - Questions & Answers - Unity Discussions