Unexpected Event Behavior in Widget BP

I have a few different dialogs in my game. I am having an issue with 2 of them that I use as generic dialogs. One has just an OK button and the other has an OK and a Cancel button. I have an additional event dispatcher in each so I can provide custom behavior if needed. It all works fine except for in some rare occurrences, the dialog is called 2 times in a row. And when its called 2 times in a row the event dispatcher is only called the first time.

Its a farkle game so for example if the player farkles I will show a single button dialog telling the user they farkled and their turn is over. The game then runs through 3 CPU player turns and then passed control back to the user when the CPU players are finished. When the CPU players are done I show a notification that it is now the players turn and then roll the dice automatically to start. If that first roll results in a farkle, when the player hits the ok button this time nothing happens. I placed a debugger and the event is not being called. So I have a feeling it has something to do with how I am using it. I could always try and not roll the dice automatically the first time when its the players turn again but I’d like to find out what is going on here.

Here is the show function of the dialog. I call it when I need to show a dialog with one button.

Here is the event that is called in the dialog when the ok button is pressed. This is called both times the dialog is opened. No issues here.

Here is a spot where I show it. The PlayerFarkled event is only called the first time.

Any ideas on what might be causing the problem?

Guessing.

What happens if you plug a target widget into the “Add to viewport” node (or self)? Or try to make the function an event.

I just tried both connecting “add to viewport” to self and making the show function an event. Doesn’t seem to change anything.

I don’t think this is the problem but sometimes if a function doesn’t have a return node it acts up even if there’s no values being returned also you could do an is valid check before adding it the viewport because widget never get destroyed

Adding the return node and an is valid check didn’t seem to have any effect. I had the IsValid node checking “Self” so it was checking the dialog right before calling “Add to Viewport”.