While loop stops the game

I created a while loop in my external events, but when i open the game and press the play button (where condition should become true) it literally stops and when i try to close it, it takes a while to do it.

These are my events:

I don’t really know what is going on and it would be a great help if you find it.

Probably because its an infinite loop. You really don’t need to use a while loop for this. Also if all you’re trying to do is disable the object rotation, you can easily toggle this in the path finding behavior menu.

To expand on what @weadsy1 wrote:

The way a while loop works is that it repeats the event over and over until the condition is no longer true.

With your while loop, it starts once gamestarted = 1. However, because you do not change the value of gamestarted within the while event (or in any of it’s subevents), it will always remain 1 and the while event will keep repeating non-stop. This means GDevelop does not get out of the loop (aka infinite looping) and no other event is ever actioned.

No actually that’s just an example. I’m planning to use it in various ways.

That makes sense, i’ll try it and see if it will work.

Thank you very much:)