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. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    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;
    }