Hi, I’m using Events with Delays in BP and would like to know if there’s something to stop / clear the Event execution, so something like timers’ ClearTimer function but for Events. I want this to avoid having to constantly (after every Delay) filter with a Branch if a certain bool is true or false. Is there anything like this in BP?
Use “Gate” which you can open and close using action connections instead of bool
Here oyu have example of use:
In you case you would use sequence to send action to “Enter” and then to “Close” and use delay to “Open” it later
Or even better " there a DoOnce node which works like “gate” but automaticly “close” when you trigger action and then you can “Reset”
Thanks for the suggestion Shadowriver, but I don’t think it’s what I’m looking for and hasn’t worked for my situation (just tried it):
In my BeginPlay event of a level blueprint there’s a long set of function calls that spawn actors in the level, with Delays between them so they don’t spawn all at once. It lasts for many seconds and theorically that isn’t repeated as it’s in BeginPlay.
I have a function outside from there called GameOver and is called when player’s character “dies”. What I want is to be able to call something at that point when the game is over that stops the execution of BeginPlay long set of actor-spawning function calls and Delays without having to check a bool after each Delay.
Is there something like that available in BP?
I don’t think what you want exists but would be cool if there was a way to get around that. As for a more bool oriented setup:
Checking this while waiting for a meeting to start so haven’t thought this through much but if you figured out a way to use a loop for your spawning then you could have a single check location at each execution of the loop.
Alternatively you could create a generic spawning function/macro with inputs for where and what to spawn and have that include a check against a bool. This is probably the approach i would take for this.
OK, if it doesn’t exist then I’ll have to keep on working with bools, with something similar to what you say: I set up a function (that needs to be executed before spawning) where it’s checked if spawning can continue (bool) and passed as and output to Branch in the main execution of the event to stop it or not.
Maybe you can spawn the logic as a separate blueprint and destroy the blueprint when you want to cancel it? I’m in the same boat as you.
Here’s a simpler way that worked for me (cancelling a teleport if player leaves the trigger volume within 3 seconds):
Here’s what’s happening: I tell the trigger start to open the gate, THEN wait three seconds before trying to enter the gate. I have another trigger that closes the gate if the player leaves, in effect cancelling the teleport. Look up the docs for Sequence and Gate under [Flow Control] for more info.