How do I have an enemy object reverse direction when it collides with another instance of the same object?

I can’t figure it out. One of them is always ignoring the event.

Can you use Phisics ?
Here an example : https://gdevelop-app.com/game-example/physics

Can you show a print of your events?

So I messed around a bit. I’m making a Mario game and was trying to get the turtle men to reverse direction when they collide. Also, I have the turtle man’s death animation turn into a shell. I need a better way to launch it. You see what I got right now. The shell keeps picking up speed. This is my first game so I’m still trying to learn the basics. Any help would be great.


I haven’t messed with physics yet. This is my first game.

I love your graph style :slight_smile:

In your last event you are doing the colision of instances of GreenTurtleMan, but in the action you are deleting it…I don’t get it. :thinking:

I tried doing it with some timers to events with the variables do not cancel each other, but the Timers work differently with colision condition. If I put 1 second, the condition will be true after the instances are coliding during one second… :face_with_raised_eyebrow:

So, I did it:

I think with that maybe you can start fixing their movement.

1 Like

Thanks a lot. This worked great. Turtle man does everything I want him to. All except for the shell. Like I said, it’s animation turns into a shell. I made 2 Direction text variables for this instance. Shell left and shell right. Depending if mario is horizontally flipped or not. It works great but now I gotta figure out how to change direction when it bounces off walls.

Thanks again.