WhileLoop not working correctly

Hey Guys

I wanted to use a WhileLoop to move the camera while a condition is met, but as soon as I put the WhileLoop in the code, the Engine doesnt want to “Play” or “Simulate”. It immediately goes back to normal editor. But when I change the WhileLoop for a Branch, it works 100%. Attached is my BluePrint code.

Your while loop’s condition is going to evaluate the same each time so it is going to fall in to an infinite loop. I imagine that if you look in your output log there will be a message about this.

How do you mean ? It’s only going to execute while it’s input condition is True. I’m checking the current mouse x/y position to the view size and should only execute a left/right/up/down movement when the mouse position is smaller/greater than a certain point. To make it more clear here is my entire blueprint for that section, but i changed the whileloop for a branch.

There is another thread about this in which Marc has suggested a method to solve what you are after: