Communication between widgets
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:
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:
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:
thanks for your patience. I hope to hear from you soon guys!
asked Nov 10 '14 at 07:54 AM in Blueprint Scripting
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.
Follow this question
Once you sign in you will be able to subscribe for any updates here