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.
  2. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

Third Party Mirror does not work

Discussion in 'Multiplayer' started by Ze1ro, Dec 21, 2022.

  1. Ze1ro

    Ze1ro

    Joined:
    Jul 28, 2022
    Posts:
    8
    The problem is that when the player enters and takes his name, it does not appear to the other player
    The code I used

    Use Mirror:

    [SyncVar(hook = nameof(SetColor))]
    public string name;
    public TMP_Text nametext;
    void SetColor(string _, string newColor)
    {
    userFName = name;

    nametext = GetComponentInChildren<TMP_Text>();
    nametext.text = newColor;

    }
    public override void OnStartServer()
    {
    base.OnStartServer();
    userFName = MssqlConnection.user.userLName;
    Debug.Log(name);
    nametext.text = userFName;
    }
     
  2. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,324
    Please check out our the Mirror/Examples folder & Documentation to get started :)