Delay cause Custom Event Loop to break

A Delay node has its own execution context. Everything before the Delay is no longer in scope when it proceeds to the next node.

If you need to have a delayed loop, then dont put a delay inside a for loop.
Instead create a Timer event and a counter integer variable which you increment every time the event runs.

Observe this blueprint. I am trying to hide then unhide a sprite inside a loop that suppose to last for two seconds with a 0.1 second interval, causing it the sprite to blink.

Blueprint

However, the delay does not work like “sleep” in c++. Whenever it hits Delay, it goes back to the top of the function (Blink) and repeats itself. It will hit the first Delay like 5-6 times and the second Delay like 3 times before finishing the loop of those two seconds.

Oh i see you are not using a for loop now that i see your screenshot.
So here’s another idea.

Instead of a Show, then Delay, then Hide,
do this:

Blink goes to a Flipflop node. Output A goes to Show, Output B goes to Hide. No delay node, just every 0.1 seconds it toggles the hiddenness to be opposite of what it was last time the 0.1 second timer fired.