ASYNCH LOOPS (or how to flash a light?)
-
Let’s say I have an object that I want to flash off and on a certain number of times (like a strobe light) which I will do by cycling the visibility of the object.
The normal logic would be to loop x number of times, turning the visibility of the object off, waiting some time, and turning it back on again, and waiting again for a time before proceeding through the next iteration of the loop (as in the example below on the right, which doesn’t work). Instead I get to see just a single iteration of the light turning off and back on again. I am guessing this is due to asynch behaviour.
So instead, I need to resort to a convoluted behaviour as seen on the left in the example below (and that’s just representative of flashing 3 times) - so the example on the left achieves what I want but is convoluted. The example on the right is the approach I would prefer to take, but doesn’t give me the result I want. Any suggestions?

Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login