Hi there,
first, here’s my setup:
I have an IA_pause input node in my first person char BP that checks wether or not pause menu widget is on screen or not and depending on that adds it to viewport and pauses the game or removes the pause menu widget from viewport and unpauses the game.
In addition to that I have set up the pause menu in a way that not only by clicking the “resume” button with the mouse gets you back into the game but also by pressing the same IA_pause input on your keyboard.
Besides that I have an animation in the pause menu widget for all the pause menu buttons set up that plays forward on “on hover mouse” event and plays reverse when on “on unhovered mouse” event.
Now here’s the problem, respectively what I am having troubles with:
Whenever I am hovered over one of those buttons and press the key on keyboard to remove the widget from viewport and then open up pause menu again, that button is again in hovered state.
Pause menu takes a short moment to actually show up, so even when I press pause key and quickly move away the mouse so the cursor is somewhere else that button that was previously hovered over remains in hovered state.
I have tried things like play reverse or set current animation time to 0 or play animation with reverse, forward and also restore state when closing pause menu to kind of reset the anim state. With the player controller node hooked up, as well as the widget reference. From first person char BP and from inside the widget.
Actually I even added get cursor position, added 300 positive on the X and set cursor position to that, but still the button that was hovered over and not unhovered before pressing the “close pause menu” key remains in hovered state.
It’s “only” cosmetic but it’s a nasty cosmetic issue for me.
I am thankful for everyone helping me with that one because I don’t know if it’s my logic that fails here or if I am missing knowledge … or something else.
Thanks up front,
Chris