Download

Problem with Delay in Custom Event, the rest of code doesn't execute

If I create a Delay node in a Custom Event, the rest of code after Delay doesn’t execute on Completed. Does anyone know why?

c8e13de34785918ed9688651d341464726837547.jpeg

This code run fine, the variable PressButtonMissionFailed is set correctly.

5741fb739ad3f898dc4c084027fed3d38726131f.jpeg

But if I create a Delay node before the Set, the variable PressButtonMissionFailed isn’t set.

415e6906690c040b7d3e09f2057085fb015083c1.jpeg

I don’t know what the issue is but if you haven’t already you should print string after your Mission Failed boolean and plug the output of the mission failed boolean to the print string to verify it the nodes are being hit and the boolean really isn’t being set. If the print string doesn’t fire at all then somewhere else in your programming the blueprint must be getting destroyed or canceled out some how before the delay resumes. You coul try shortening the duration and see if the fire sneaks through before whatever is breaking the chain.

Probably the boolean is setting and your issue has something to do with the delayed boolean set getting canceled out somewhere else in your programming

I added a breakpoint in SET, but it’s not triggered if it has Delay node before it.

This event is called from a GameInstance function. Could this cause the problem?

Ok, the problem is because the Delay is not executed in Game Paused. I don’t know how solve it…

can you trigger the mission failed boolean before the game pause. Or trigger the boolean in the UI event graph.

Actually research the set game paused node. I forgot where it is located but there is a tick box somewhere you can press so that the game pauses gameplay without pausing the editor/input and code.

I’m trying to freeze/lock movement of the vehicle controlled by the player instead of using Pause Game node.

Any idea how I can do it? I will search on Google if I find out how too.

Ok, “Enable input” and “Disable input” nodes works fine :slight_smile: