How to Move an enemy back and forth on a platformer

Hello, I’ve recently began my first game in gdevelop and its all gone smoothly till i started working on the enemy, no matter what i would do the enemy wouldn’t work right, he’d always run into the right wall then stop moving

This is what i used.

![Gdevelop Enemy problem|690x451 (upload://rMk58i208231Fl1PgHFGtpq2kBN.png)

Right now the Enemy wont move at all and i really need a solution

I’m sorry it isn’t working. Unfortunately your code snippet is not showing up, so I can only point you in the direction of other resources. Luckily GDevelop has made a lot of great tutorials on YouTube:
Create Enemy AI for Your Game
Creating a Platformer Game --Adding Enemies
Add Interesting Enemies
I hope those help. Good luck with your first game!

This is how i make my enemies move

A screenshot of the game

screenshot 2

and in the events you use at the beginning hide objects to hide the right and left arrows.

Did you checked collision masks?

Also I would like to point out, that in gdev 0 deg is to the right and 180 deg is to the left (90 bottom, 270 up).

Change your degrees around. Make Right be 0 degrees and make Left be 180 degrees.

The enemy is only going right because of a domino effect.

Try checking for states with a cooldown, or you can implement it just like how I implemented it by checking for an instance variable when the player/enemy is in collision with a flip object (See the GIF below):

Screencastfrom2024-07-1400-53-55online-video-cutter.com-ezgif.com-optimize