UMG Buttons Require Two or More Button Presses to Work Properly

Hello,

I’ve been working with some different UMG Widgets and noticed that whenever I start playtesting, the buttons on my Widgets require two (or more) button presses to complete their executions. Most of the time, however, they’ll hit one node, then stop, and upon being clicked again hit their last node.

For example…

On the left hand side of the screen there is Text printed to indicate that the OnClicked event did run, but the buttons don’t disappear. It’s not until the second click that the buttons are set to Hidden AND the Text appears a second time.

The Blueprint for this setup is…

I also tried it with an entirely different Widget where instead of Remove From Parent I tried to change the Visibility.

The same results happen; it requires two clicks of the Button to get them off the screen.

Is there any particular reason why the Buttons will execute the first nodes in their code (i.e. either printing the text or making another text block appear), but won’t remove themselves until another click occurs?

Any help is appreciated!

How are you adding the UI to the screen? I had a problem similar to this, and it seemed for some reason that there were TWO instances of my HUD widget on the screen. You can probably wire up some nodes to test if that’s happening to you, like slightly randomizing the position of some widgets.

In my case, moving the Create Widget/Add to Viewport nodes to my PlayerController instead of my GameMode seemed to solve the problem. Still no idea why it was happening.

Thank you for replying, you helped me figure out the issue.

I created the widgets (and added them to the Viewport) in a NPC Blueprint Class. In order for that to execute, I first had it start with a BeginOverlap with a Box Component. The problem being that, it seems, the Widget is infinitely created so long as the player is in the Box Component.