[SOLVED] NPC Ignores Collision of one object, but not the other

How do I…

Trying to make a pathfinding system where if a guard hits a waypoint, they walk in the opposite direction, making a looping patrol

What is the expected result

Guard hits waypoint, turns around and walks, when they hit another waypoint the same happens (they turn around and walk)

What is the actual result

Guard ignores waypoints when they’re walking to the right, but not when they’re walking to the left

Related screenshots



Hello, MyNameIsAK

The Gdevelop reads the events from top to the bottom. Here, when the variable “MoveRight” changes to False, in the next event it’s false, so it turns to True again.

You can use the toggle action for boolean variable:

Maybe this will solve your problem.

Thanks, it works now

1 Like