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.