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"

Display username above player?

Hello, I am on the last part of my game and that is add the name tag above the players head to identify him/her. I have a login system with mysql where you can go to my localhost and register a username and password required to get into the game. what I want to do is display that registered username above the player. I've tried making a seperate widget component and binding a function (the users username is stored in a string varaibel) but when I add get username it asks for a target and I don't know what the target would be, Any help would be great!!?

Thanks!!

alt text

Product Version: UE 4.18
Tags:
picture.png (90.8 kB)
more ▼

asked Dec 31 '17 at 05:48 AM in Everything Else

avatar image

bryson.yaeger
56 1 6 6

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

2 answers: sort voted first

Hey there, is that username variable in the widget? If it is and it already has the value it needs to have, delete that node and do get username to recreated it without the self. If it's not then you need to access the place it has that information, if it's in your character then you need to do get owning player pawn, cast to your character bp and from there access the variable.

more ▼

answered Dec 31 '17 at 11:32 AM

avatar image

xlar8or
6k 163 130 305

avatar image bryson.yaeger Dec 31 '17 at 03:39 PM

No, It is a variable stored in a game instance.

avatar image xlar8or Dec 31 '17 at 03:52 PM

Then you just need to do Get Game Instance, cast it to your custom version and access it from there.

avatar image bryson.yaeger Dec 31 '17 at 03:56 PM

I am very sorry, I am just switching over from unity and have no idea how to use blueprints, Can you send me a screen shot if you can, I'd really appreciate it! Also what do you mean cast to custom version?

avatar image bryson.yaeger Dec 31 '17 at 04:42 PM

Hello? I really need some help here.

avatar image xlar8or Jan 01 '18 at 02:02 PM

Im on smartphone right now but if you right click on an empty spce youll find the get game instance node, from that you drag a wire and type cast to "your game instance subclass that has the the username variable". From that cast you can search for the username variable.

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

I believe you can use a widget to get there text over the player

more ▼

answered Dec 31 '17 at 06:26 PM

avatar image

Blackforcedragon
0 3 8 12

(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