Displaying players name above in multiplayer

Hi!

In my game, every player has a child GameObject called “NameAbove” which contains GUIText component. Here’s my code:

//class Player
void Update()
{ 
    //if(networkView.IsMine)
    if (dataSet && !nameSet)
    {
        SetNameAbove(this.characterName); // i've tried also RPC - no result
    }
 }
       
    [RPC]
    void SetNameAbove(string n)
    {
gameObject.transform.FindChild("NameAbove").GetComponent<GUIText>().text = n;
        nameSet = true;
    }

So i need every player to display his own name having set it to his child GO in GUIText component.

Thanx in advance.

You need a canvas. A player should have a small child canvas set as World Space. Canvas should have an child object with Text. Canvas should have some script that will be facing the canvas to the camera. That is a “modern GUI” approach.