Communication between widgets

Hello everybody!

I am currently trying to make a GUI for our game. For now, I have a title screen spawning at the start with working buttons on it and all. I also have a pause menu shich pops out when I press ENTER (for now). Finally, I have a widget that appears when you collect a marble in the level.

For my pipeline, I made 3 animations for the Collectible HUD:

  1. When you got marble, it comes down and goes up after 2 seconds
  2. When you press ENTER (Pause), it comes down and stops
  3. When Pause is removed from viewport, the HUD goes back up (not working)

All of them separately work very well, but the problem is this:

When I call the Pause menu Widget, I want to call the Collectible Widget too. It works fine, as I call the 2 of them in the Character Blueprint when the input is pressed.

Here is the 2 functions I call, which are similar:

Pause Menu:

Collectible HUD

But when I press the Resume button, which is making the pause menu leaving the viewport, I try to trigger the animation of the Collectible HUD going back up and hide OFF screen, but it stays in screen.

This is the pause screen, called as I want…but the thing at the top doesn’t go up after Pause is gone.

This is the Pause Widget (top) and the Collectibles widget (Bottom):

My question, finally, would be 3 questions:

  1. Is it possible that my event in Pause is just checking one time all the nodes and it is the cause of the bug (because when the pause menu is closed, it doesn’t trigger an event begin play)? In that case, is there an event that can check multiples times the blue print so it can detect when the game is unpaused?

  2. Is there a way to call an event in a widget blue print, and make that event’s following nodes in another widget blueprint? (I tried with casting…but it doesn’t work between widgets (or is it?)) It would allow me to call an event when Pause is started and when Pause is finished, so i could start from these events in my collectibles blue print.

  3. If you think my way is bad and you have any good idea to make this working, I can take it :stuck_out_tongue:

thanks for your patience. I hope to hear from you soon guys!

Nobody has an idea? Sorry for my persistence…I am just worried about a project I work on and which needs this…

Just looking at your graphs, Your Hide Marbles animation is never called because the pause boolean is never false along that branch of the original if statement and on both the true AND false branches of the original if statement, you have the animation show marbles called. I don’t actually see anything in the graphs you have listed here that would cause it to execute on unpause.

Personally, I would take all the animations and put them in events with event dispatchers, and simply call the event dispatcher when you want them to fire. So, something like:

A) Create animate to screen event (with Dispatcher)
B) Create animate off screen event (with Dispatcher)
C) Create Keypress Event that checks the pause Bool, if unpaused, call event A & Set Bool to true. If paused, call event B and set value to false.
D) In your UMG widget, take the bind function of your Resume button and call Event C via event dispatcher.

If you need an example, let me know, I can probably hack something together.

I managed to do it by creating a home made event tick, as shown in the next picture (with a little help from a classmate). I share it as people can see it.

It allows me to check, while the collectibles widget is opened, many times if the game is paused and it works fine now!

Thanks RAVaught for your answer tough! It will surely help me in future works with UMG! (I upvoted you! Thanks)

I’m glad you got it working! Looking at your new graph though, I have a question for you. Why do you have the Hide Marble animation looped back into the delay node?

Hahaha well, I didn’t even think about it when I put it back in the delay. I sure could take it off, you’re right!

Thanks!