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

SyncVar problem

$
0
0
I scripted this script in c#:

Code (CSharp):
  1. using UnityEngine;
  2. using System.Collections;
  3. using UnityEngine.UI;
  4. using UnityEngine.Networking;
  5.  
  6. public class GetText : NetworkBehaviour {
  7.  
  8.     [SyncVar]
  9.     public string Live;
  10.  
  11.     [SerializeField]
  12.     Text abc;
  13.  
  14.     void Start () {
  15.    
  16.     }
  17.  
  18.     void Update () {
  19.  
  20.         abc = GetComponent <Text> ();
  21.         abc.text = Live;
  22.     }
  23. }
I attached this script to a text object in the scene.
But the string variable doesnt sync.
Can someone...

SyncVar problem

Viewing all articles
Browse latest Browse all 16796

Trending Articles



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