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.
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.
answered Jul 14 '15 at 02:09 AM
Have you tried setting the anchor point of the widget canvas panel to top left corner? or leaving it untouched.
answered Feb 09 '17 at 08:42 PM
De Ocean Pirate
Try replicate Location of NameTag I think it will work
answered Dec 04 '18 at 09:39 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here