Here are the events that manage the movement system for the enemy object group. The goal is that when an enemy (here object group “Ennemis”) collides with the player, it should move back in the opposite direction. It almost works, but I’m encountering an issue with the event “enemy is in collision with player” and its two sub-events: “the variable estTourneADroite of enemy is true" and “the variable estTourneADroite of enemy is false”. variable “estTourneADroite” (in English gototheright) is a Boolean variable. Only the second condition (“estTourneADroite is false”) and its actions are being taken into account by GDevelop. If I disable it, then the first sub-event (“estTourneADroite is true”) works. So I don’t know how to make GDevelop consider both conditions properly.
The issue is that in the first subevent, when estTourneADroite is true, it gets set to false. Then, in the subevent immediately after, estTourneADroite is false and so the event is actionsed, and estTourneADroite is set back to true.
If you only want to swap estTourneADroite from true to false and vice versa, then the simplest solution is to get rid of the two subevents, and in the main event use the action “Change the variable estTourneADroite: toggle”.