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"

Getting 2 different UMG blueprints to talk to each other.

Hello! I've been trying to figure out how to get two different Widgets to talk to each other. Lets call one General UI and the other Total. When i press buttons in the General UI i want the number on Total to change accordingly, as an example add or subtract from it, but for the life of me i can't get those 2 to talk to each other. I have tried with BP Interfaces, even event dispatchers and creating just custom events. So if anyone could give me a hint or point me in the right direction that would be much appreciated!

Cheers, Shadur

Product Version: UE 4.11
Tags:
more ▼

asked May 06 '16 at 12:39 PM in Blueprint Scripting

avatar image

Shadur
1 2 3

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

1 answer: sort voted first

With a reference to the other one, public functions and variables can be accessed. So, store a reference to one after it is made. If it's just a Widget Reference you'll need to cast it.

However, I think a much better solution is not to require UMG Wdigets to access each other. Instead save your variables in a GameMode, GameState, GameInstance, or PlayerController even, create a binding to the Widget element that gets the needed value from that.

more ▼

answered May 06 '16 at 01:54 PM

avatar image

mikepurvis
2.5k 102 67 261

avatar image Shadur May 09 '16 at 10:30 PM

Hey!

That helped a lot, sorry i didn't respond sooner. I was able to store the variables successfully through a GameInstance that i created my self. Now i can't figure out for the life of me how to get it to keep the changed value. Every time i recall the Widget it resets the text box to it's default value. What i mean is, even if after pressing the buttons and changing it to let's say from Text Box to 50, when i close the widget and recall it, it will still be Text Box. What am i missing? :D

Sorry if it's a simple answer, I'm still a complete beginner with it, loving it though! :D

Cheers, Shadur!

EDIT: Nevermind, was able to figure it out finally! I just created a new function in my UI Event Graph. which I ran with the Event Construct and that would set the value stored in the variable which was in my GameInstance. Thanks a lot for the help and info, it helped a bunch!

(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