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"

Variable To Widget Hud?

Hi, I was thinking i wanted todo something a little more advanced. I want My thirst system to show up as a value in my widget Replacing the 0 https://gyazo.com/2ebc611deaa6a36bb7b4cc9478da4f11

But i have no idea how to get my variable from level blueprint into the Widget HUD, tried to look around but didnt find anything to help me 100%.

Here is a screenshot from my level blueprint (Thirst system): https://gyazo.com/05a9447e1d78c392230ce435076d4ae8

I know you can use "Cast to" but im not 100% how that works, i only used UE4 for a Week now.

Product Version: UE 4.11
more ▼

asked Apr 14 '16 at 09:19 AM in Blueprint Scripting

avatar image

1 1 2 2

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

1 answer: sort voted first

You probably want to have your thirst variable in your player controller, player state or game state, depending on what you have already set up.

The level blueprint is a bit of a black box to the other blueprints, it would have to push the variable reference at the start up of the widget etc. it's messy.

To link the thirst variable from your class (e.g. player controller) onto the widget, there is a neat Binding technique, as follow.

In the UMG you create the widget to represent thirst and then you Bind it to the, e.g., Player controller's variable.

Here is an example.

Hope this helps :)

alt text

alt text

umg bind 1.png (44.5 kB)
umg bind 2.png (109.0 kB)
more ▼

answered Apr 14 '16 at 09:33 AM

avatar image

1.8k 66 27 90

(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