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"

How to get string variable from another widget blueprint?

how do I access a string variable in a widget blueprint different from my other blueprint For example: say I have a Login Widget Blueprint with a Player Name string variable set public that gets set in it upon login How do I access that string variable from another blueprint? I tried doing like a direct reference to the Get Player Name, but then it asks for a Target which is where I get confused...

Here are screenshots

http://puu.sh/umWjv/242bfe352c.jpg

http://puu.sh/umWlu/6932baa186.png

Thats in the login blueprint and then in my displaymessage blueprint

http://puu.sh/umWoK/9efeb0ea3f.jpg

how do I actually call that variable "Player Name" from the Displaymessage widget blueprint?

Product Version: UE 4.15
Tags:
more ▼

asked Feb 28 '17 at 01:36 AM in Blueprint Scripting

avatar image

carsenk
1 2

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

1 answer: sort voted first

Hey Carsenk!

Basically what you would need to do is simply store this string variable somewhere where it can be accessed. Because you mentioned you would like this to be the login information, and possibly get this information whether you are in a menu or in game.

The best place would either be saving out this data locally in a save game file, OR alternatively you could set this in the Game Instance (Which is consistent across the game session). This will allow you to Get the game instance -> Cast to the Game Instance -> And **Get**ting the Player Name variable.

Keep in mind that each client will only see their own Player name variable. If you would like other players to know about this name then setting this within the player state when the game starts (From the game instance/save game at the start of the game).

Hope this helps!

more ▼

answered Feb 28 '17 at 10:30 AM

avatar image

Prototype6143
58 9 11 21

(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