Why does this while loop give me an error?

Haven’t messed with UE4 in a few months but I know you can’t have them inside functions it won’t even let you add the node (I found a work around for that though) but I am pretty sure that using it within a loop body like that won’t work because even though the delay will prevent further execution until the is finished (which is the problem) the loop will attempt to complete its body in the frame that it was called leading to a bunch of executions that are prevented by the delay from actually incrementing the integer condition the loop is checking for hence you run into an infinite loop error.