How to Create a Loop Using a Boolean as a Condition

Hello! I am currently trying to create the effect of my character flashing after it has taken damage by using some sort of loop that will execute the code while a boolean remains true. I tried to use a “While Loop” node but all I get is an infinite loop error, and I can’t seem to work a way around it.

Is anybody able to help me find a solution? Thanks!

My code:

1 Like

Like this

You see, the moment the engine sees ‘latency’, like this


It will fork that chain of execution and continue with the rest of the code. So they way you have it set, no delays will actually happen.

So, you have to force it to use the delay nodes, as above.

PS: You need to give it a way out, by clearing the variable :wink:

1 Like