WidgetComponent - name over player's head

I am trying to display the player’s name above their head in a network game.

I found a lot of tutorials for doing it with 3d text and then having that rotate to face the camera. I really didn’t like the effect that gave though.

So, I am trying to use a WidgetComponent with screen space.

First, I created a Widget Blueprint which contains a Text for the player Name.

I then modified it’s Graph to set the text to the player name.

Next, within my Character blueprint I added a Widget component as a child of the CapsuleComponent.
And set the Widget Class to my NameTagWidget and Space to “Screen”.
And then I dragged the position to be above the player’s head.

However, I am getting weird results that are confusing me.

1) The name text isn’t showing up above the player’s head. It is also moving just from looking around with my player.
2) The text is showing MY name instead of the other player’s name.

Below are screenshots showing the two issues.
The circled red text showing “357” is being rendered on the HUD so that I can see my player’s name to compare against.

The circled green text showing “357” is what we are interested in. It’s the player’s name that is supposed to be showing up above the player’s head. But instead it is moving all over the screen when I move/look around.

The next screenshot is the same player and all I did was look around and the text moved.

If you open the engine settings, engine scalability settings in your editor and set the resolution scale to 100% it should fix the positioning. As for your other issue, the owning player of the widget isn’t the character that contains the component. In your character blueprint you should be able to access and set the variable for the character that owns it.

I don’t know how to set the variable for the characters that own the widget :frowning: Please help me

I have the same question.

Have you tried setting the anchor point of the widget canvas panel to top left corner? or leaving it untouched.

Did you find a fix for only showing the username of the client?

Try replicate Location of NameTag I think it will work

tutorial how you can do it