How is this an infinite Loop?

I am making a gun that must charge up before beginning to fire rapidly and I used a while loop to add up time using a delay node until it is done charging before setting a timer to call the fire function. The while loop executes while the player is still holing the fire button and the float being incremented in the body has not reached 1.05. I have attached a picture of the loop in question. My current understanding is that if the player continues to hold the fire button, the loop will execute eleven times and then move on. When I go to play in selected viewport it crashes as soon as I press fire and it tells me that it detected an infinite loop. I don’t understand how this is an infinite loop. either I am right and I need to know about exception handling and how to make it “throw” some exception or I am wrong and need a different way to get the amount of time passed.

If I had to guess why it’s not working how I expect, it’s probably because I have a skewed idea of how the delay and DoOnce nodes work.

i wouldnt use a while loop here myself i would probably use a timer instead.

While Loop Training

You could use a Timeline for this method, which will allow you to decrease the charge easily if they don’t fully charge the weapon, or just stop it as a set charge when they release the key. Here’s a quick example:

The timeline used:

I think that a timeline is the way to go because I could also back up and play forward the laser charge sound and point light on the end of the gun. previously, I hooked up some script to the event tick to handle uncharging the gun. I’ll mark the answer as correct once I successfully implement the timeline.

Do you have any idea why the original while loop was an infinite loop? Do I misunderstand delays or something?