Infinite While-Loop Detected

Hello, I am new to blueprints and have been trying to get my hands dirty by making a deathrun obby game without having to watch a youtube video. I have been able to make a working checkpoint system and a way to teleport to the checkpoint when you fall off the map.

That being said, I am currently stuck trying to make a floor rotate back and forth. My understanding of what I (thought) I did was… As long as my int value X (X starts as a value of 1) does not equal 10, it will run the body of the while loop. In the body of the while loop, it will increment the value of X by 1.

I have been programming in other languages for some time but I am unable to translate my logic of a while loop to blueprints.

You cannot use a delay node in a while loop. You can make a custom while loop using a branch that keeps getting looped back to, but delays are not allowed.

The while loop functions all in one frame. That Set X never gets reached since that’s after however many frames a second ends up being.

Here’s my suggestion

Your logic can also be clarified by changing != 10 to < 10.
You can also change rotation rate to be XRotationRotate of type float instead of using an entire rotator.
Consider a more descriptive variable name. X says nothing about the variable’s usage.

2 Likes

Thank you. I was mostly just using X to test. I understand now. I was also able to get it to work properly.

2 Likes