Back and forth behavior


I added the back-and-forth behavior to my sprite, but it doesn’t move when I start the game.
Should I add any code or other behavior to the sprite?


Hi !

For what you are trying to achieve you will need this Timed Back and Forth Movement - GDevelop documentation, your sprite has to have this behaviour added to it, and no specific additional code is required, if your events aren’t colliding it should work on its own as you start the scene.

You can also recreate the same thing quickly in a new project by using forces and some local Boolean variables, which is the same thing on what this extension was made. I would recommend making a quick new project and recreating just this steps.

Hopefully I have answered your question.

1 Like