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 have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Bug Name Multiplayer

Discussion in 'Immediate Mode GUI (IMGUI)' 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;
    }