x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

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. alt text

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

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. alt text

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.

alt text

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

Product Version: UE 4.8
Tags:
blueprintwidget.png (145.4 kB)
getplayername.png (140.7 kB)
results_1.png (584.2 kB)
results_2.png (513.8 kB)
more ▼

asked Jul 13 '15 at 06:04 PM in Blueprint Scripting

avatar image

erebel55
385 43 46 66

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

4 answers: sort voted first

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.

more ▼

answered Jul 14 '15 at 02:09 AM

avatar image

HighlySpammable
101 2 3 7

avatar image tueurdudimanche Feb 07 '16 at 05:15 PM

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

avatar image Robotdjman Jun 29 '17 at 01:07 AM

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

avatar image WhyAreLess Nov 10 '16 at 08:58 PM

I have the same question.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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

more ▼

answered Feb 09 '17 at 08:42 PM

avatar image

De Ocean Pirate
27 7 11 14

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Try replicate Location of NameTag I think it will work

more ▼

answered Dec 04 '18 at 09:39 AM

avatar image

Ra1n1998
1 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
more ▼

answered Dec 04 '18 at 09:40 AM

avatar image

Ra1n1998
1 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question