# Widget Animation Problem (UE 4.27)

**URL:** <https://forums.unrealengine.com/t/widget-animation-problem-ue-4-27/616825>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [July 29, 2022, 2:33am UTC](https://forums.unrealengine.com/t/widget-animation-problem-ue-4-27/616825 "2022-07-29T02:33:26Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![CurleeD85](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CurleeD85](https://forums.unrealengine.com/u/CurleeD85)\
**Post date:** [July 29, 2022, 2:33am UTC](https://forums.unrealengine.com/t/widget-animation-problem-ue-4-27/616825/1 "2022-07-29T02:33:26Z")

</div>

I’ve run into a weird widget problem. Whenever one of four arrow buttons is clicked and this robot character I have moves from room to room, the arrow buttons are supposed to be collapsed until the animation is done. But, for some reason, the arrows appear too soon and are clickable when they aren’t supposed to be, even when I’ve set all four arrow buttons to be collapsed before the animation starts and become visible after the animation finishes and the delay is executed. Could this be a bug?

Here is the widget with four directional buttons. Next are the two links that show the behaviors of the left and right arrow buttons; all of these buttons operate on an counter-based integer that tells the program what room the robot navigating its way through the maze is in.

 ![Screenshot1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/1/e/d1e5c9581b955e7a9563f11bd87c6c97d66ce820.png)

When in Room 25 and the right button is clicked: [Right Button for Room 25 posted by anonymous | blueprintUE | PasteBin For Unreal Engine](https://blueprintue.com/blueprint/-5_bfxdl/)  
When in Room 26 and the left button is clicked: [Left Button for Room 26 posted by anonymous | blueprintUE | PasteBin For Unreal Engine](https://blueprintue.com/blueprint/dq1h1yic/)  
Entire Blueprint for the widget: [Maze Navigation Widget posted by anonymous | blueprintUE | PasteBin For Unreal Engine](https://blueprintue.com/blueprint/pvjwsl46/)

[Project427 - Unreal Editor 2022-07-28 16-32-30.mp4 - Google Drive](https://drive.google.com/file/d/1nN9EQnLWnnIAqUYYyf5u4oMrf40lS3h7/view?usp=sharing) – and here is a video clip showing what’s happening right now.

Please bear in mind this is a 2D widget interface.

---

<div class="post-metadata">

**Author:** ![vespineauto007](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@vespineauto007](https://forums.unrealengine.com/u/vespineauto007)\
**Post date:** [July 29, 2022, 3:15am UTC](https://forums.unrealengine.com/t/widget-animation-problem-ue-4-27/616825/2 "2022-07-29T03:15:49Z")

</div>

Not sure this is THE problem; however, your event will occur whenever it is triggered regardless if the prior event has completed execution given the “long” delays, or not. What might be happening is the previous event, or multiple previous events, might still be running trying to do its thing while the current event may be running trying to do its thing… …possibly resulting in a clustered mess.

On events similar to yours that I programmed into that I could not rework, I added a unique boolean flag to this process called something like “MyProcessIsRunning” which is checked at the beginning of the event for false, set true once started and set false when completed.

---

<div class="post-metadata">

**Author:** ![CurleeD85](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CurleeD85](https://forums.unrealengine.com/u/CurleeD85)\
**Post date:** [July 29, 2022, 3:17am UTC](https://forums.unrealengine.com/t/widget-animation-problem-ue-4-27/616825/3 "2022-07-29T03:17:52Z")

</div>

So basically, I should put in a Boolean that turns this and that off? Do you think I should make one for each of two widgets? One widget controls movement in the first half of a maze in part of a level, and the other widget controls the second half; that other widget is what I’m having trouble with.

---

<div class="post-metadata">

**Author:** ![vespineauto007](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@vespineauto007](https://forums.unrealengine.com/u/vespineauto007)\
**Post date:** [July 29, 2022, 3:26am UTC](https://forums.unrealengine.com/t/widget-animation-problem-ue-4-27/616825/4 "2022-07-29T03:26:12Z")

</div>

I would say if the event is “long” in execution and that the goal of that event is to complete its execution prior to the next event, you may need some flags to prevent future event triggers from interrupting the current event being executed.

This might be the source of your issue (or) it might reveal the next Scooby clue.

---

<div class="post-metadata">

**Author:** ![CurleeD85](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CurleeD85](https://forums.unrealengine.com/u/CurleeD85)\
**Post date:** [July 29, 2022, 3:27am UTC](https://forums.unrealengine.com/t/widget-animation-problem-ue-4-27/616825/5 "2022-07-29T03:27:54Z")

</div>

This is part of a tech demo and in the final stretch of the fifth level, so it is part of a larger set of BPs, widgets and the like. Anyway, what would you suggest I make Booleans for? Or would it be a good idea if I, for example, had the arrows remove all widgets then refresh the current widget and set the Level Counter to its proper number?

---

<div class="post-metadata">

**Author:** ![vespineauto007](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@vespineauto007](https://forums.unrealengine.com/u/vespineauto007)\
**Post date:** [July 29, 2022, 3:29am UTC](https://forums.unrealengine.com/t/widget-animation-problem-ue-4-27/616825/6 "2022-07-29T03:29:50Z")

</div>

Searching my code for an example…

---

<div class="post-metadata">

**Author:** ![vespineauto007](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@vespineauto007](https://forums.unrealengine.com/u/vespineauto007)\
**Post date:** [July 29, 2022, 3:44am UTC](https://forums.unrealengine.com/t/widget-animation-problem-ue-4-27/616825/7 "2022-07-29T03:44:01Z")

</div>

So In my MainMenu I search for game sessions. There is a Join button. I want to prevent multiple events of “On Clicked (JoinButton)” until the current join process has completed. Thus, I created a boolean called “JoinPressed”. My BP code looks as follows:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/9/6/2960628781174a0be9bbec3493459701116a5e03.png)

This could be bad; however, I used the “Event Tick” to check to see if “JoinPressed” is true. If so, I wait at least 2 seconds (JoinPressedLimit) of which after that point I clear JoinPressed and allow for the Join button to cause the event’s functionality to trigger again.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/3/f/73f2f9d543d7cced4c9cd9ec920f69b6c0f35106.png)

Not super proud of this; however, I am proposing that given your code to add the equivalent “JoinPressed = false” at the end of your event’s execute paths (not recommending that you use Event Tick to clear your “I am processing” flag).

Helpful???

---

<div class="post-metadata">

**Author:** ![CurleeD85](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CurleeD85](https://forums.unrealengine.com/u/CurleeD85)\
**Post date:** [July 29, 2022, 3:54am UTC](https://forums.unrealengine.com/t/widget-animation-problem-ue-4-27/616825/8 "2022-07-29T03:54:18Z")

</div>

So, the Event Tick is to maintain the Boolean’s true state? And, each time an arrow button is clicked, that Event Tick would be used to make sure that the buttons are only visible while the Boolean is true?

---

<div class="post-metadata">

**Author:** ![CurleeD85](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CurleeD85](https://forums.unrealengine.com/u/CurleeD85)\
**Post date:** [July 29, 2022, 5:04pm UTC](https://forums.unrealengine.com/t/widget-animation-problem-ue-4-27/616825/9 "2022-07-29T17:04:22Z")

</div>

This isn’t for a multiplayer game, but is the point that the Boolean could be controlled by some floating integer?

---

<div class="post-metadata">

**Author:** ![vespineauto007](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@vespineauto007](https://forums.unrealengine.com/u/vespineauto007)\
**Post date:** [July 29, 2022, 6:27pm UTC](https://forums.unrealengine.com/t/widget-animation-problem-ue-4-27/616825/10 "2022-07-29T18:27:48Z")

</div>

Yeah the example is multiplayer but the point is that a boolean can be used to prevent additional events from happen while the current event is resolving.

The microprossor equivalent I am thinking of is that events are like interrupts in that there is an interrupt service routine which is the code after the red event block. If your interrupt service routine is too long, you have to disable future interrupts until that service routine is finished. Same is true in UE.

Add print statements right after the red event block and at the end of each possible execution path. I claim the desired result should be a begin print statement followed by an end print statement.

I claim your code might have multiple begin statements before a end statement is printed. If this is indeed happening, you need to stop, or prevent, this from occurring.

---

<div class="post-metadata">

**Author:** ![CurleeD85](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CurleeD85](https://forums.unrealengine.com/u/CurleeD85)\
**Post date:** [July 29, 2022, 7:06pm UTC](https://forums.unrealengine.com/t/widget-animation-problem-ue-4-27/616825/12 "2022-07-29T19:06:12Z")

</div>

And the Event Tick goes in the widget’s BP, right? The two widgets are separate, but it would still make sense to put this tick in each, just to force each one to refresh itself.

---

<div class="post-metadata">

**Author:** ![vespineauto007](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@vespineauto007](https://forums.unrealengine.com/u/vespineauto007)\
**Post date:** [July 29, 2022, 7:09pm UTC](https://forums.unrealengine.com/t/widget-animation-problem-ue-4-27/616825/13 "2022-07-29T19:09:57Z")

</div>

Sorry. My example is bad/misleading. I will work up another example in a little bit.

---

<div class="post-metadata">

**Author:** ![CurleeD85](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CurleeD85](https://forums.unrealengine.com/u/CurleeD85)\
**Post date:** [July 29, 2022, 8:02pm UTC](https://forums.unrealengine.com/t/widget-animation-problem-ue-4-27/616825/14 "2022-07-29T20:02:08Z")

</div>

It’s okay. Still, I appreciate your help, so far.

---

<div class="post-metadata">

**Author:** ![vespineauto007](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@vespineauto007](https://forums.unrealengine.com/u/vespineauto007)\
**Post date:** [July 29, 2022, 8:06pm UTC](https://forums.unrealengine.com/t/widget-animation-problem-ue-4-27/616825/15 "2022-07-29T20:06:47Z")

</div>

Just for you… 🙂

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/e/c/dece5d29ca4de2949042dbc2b3088f79d7abf2bf.png)

---

<div class="post-metadata">

**Author:** ![CurleeD85](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CurleeD85](https://forums.unrealengine.com/u/CurleeD85)\
**Post date:** [July 29, 2022, 8:09pm UTC](https://forums.unrealengine.com/t/widget-animation-problem-ue-4-27/616825/16 "2022-07-29T20:09:16Z")

</div>

Is this a newer example? I’m a bit confused (though I am thankful for the thought).

---

<div class="post-metadata">

**Author:** ![vespineauto007](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@vespineauto007](https://forums.unrealengine.com/u/vespineauto007)\
**Post date:** [July 29, 2022, 8:24pm UTC](https://forums.unrealengine.com/t/widget-animation-problem-ue-4-27/616825/17 "2022-07-29T20:24:54Z")

</div>

This new example is what I am recommending.

My other example with “Event Tick” is overly complicated in that I did this because my “On Clicked(JoinButton)” event finishes fast; however, it calls the event “Join Session” which finishes slow and I am waiting the 2 secs incase the “Join Session” event fails for whatever reason. Actually, I also did this code because was really trying to prevent accidental double or triple clicks on the “Join Session” widget button. Essentially debouncing my “Join Session” button at a 2 second interval.

---

<div class="post-metadata">

**Author:** ![CurleeD85](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CurleeD85](https://forums.unrealengine.com/u/CurleeD85)\
**Post date:** [July 29, 2022, 10:52pm UTC](https://forums.unrealengine.com/t/widget-animation-problem-ue-4-27/616825/19 "2022-07-29T22:52:41Z")

</div>

Do I need to put anything in that function in the picture?

---

<div class="post-metadata">

**Author:** ![CurleeD85](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CurleeD85](https://forums.unrealengine.com/u/CurleeD85)\
**Post date:** [July 29, 2022, 11:46pm UTC](https://forums.unrealengine.com/t/widget-animation-problem-ue-4-27/616825/20 "2022-07-29T23:46:06Z")

</div>

Er, wait. That stuff that I replace the function and delay with is the set of if-then-else branches with the level counters? And does this go in the widget’s BP? Or the level’s BP?

---

<div class="post-metadata">

**Author:** ![vespineauto007](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@vespineauto007](https://forums.unrealengine.com/u/vespineauto007)\
**Post date:** [July 30, 2022, 12:12am UTC](https://forums.unrealengine.com/t/widget-animation-problem-ue-4-27/616825/21 "2022-07-30T00:12:04Z")

</div>

Your code/stuff/functionality replaces the made up function and the delay in the commented section. Do note that if you have multiple exit points in that event you will need a “WaitUntilDone = false” for each of those exit points…
