[Solved] Why the pathfinding go the wrong way, and the platform character can walk in the sky?

Why the pathfinding go the wrong way, and the platform character can walk in the sky?

|Object| behavior|Memo
|thief| PlatformerObject| Controled by the player
|police| Pathfinding & PlatformerObject| to catch the thief by Pathfinding AI

The expected path should be the following.

But when run it, the police can walk in the sky.

The events:

I could not upload the whole project in the police_catch_thief.zip. Can someone tell me how to upload zip file?

Best Regards.

the pathfinder behavior isn’t see your game’s perspective. as far as I know it is for the top-down view games, like the top-down movement behavior.
for a side view platformer of hack & slash game you are need to code an “enemy AI” wich will guide your policemen. I bet you can find tutorials on the internet for that.


Thank you. I got it.

1 Like

Be careful because users who have seen the @The_Gem_Dev tutorial may be confuse.
As @Gyuszko says, pathfinding system is reserved for top-down behavior only.

At the moment I don’t think there is solution to make a pathfinding in a platformer game.

As others have said, you can’t use the pathfinder behaviour here.
For this specific case it would be enough to do something like:
check if enemy is in collision with ladder, if yes start climbing (up or down depending on relative Y position to the ladder), once he touches the grond set his state to walking again and set a timer to make sure he doesn’t climb up imediatly again.
Just to give you an idea.

1 Like

Thanks for your reply.

You must have seen this video.
First of all the issue of the police following the thief.
The pathfinding behaviour moves the pathfinding object directly to it’s target. from the screenshot above https://forum.gdevelop.io/uploads/default/optimized/2X/3/37ab63d68bfc18d736b9af087d26873523b42315_2_690x439.png thats how its expected to work (directly to the “thief”). it will not use the ladder in order to get to the thief.

Yes you are right. But with good knowledge of GDevelop a pathfinding platformer game can be made. like i did in the tutorial. Presently the issue i have with the pathfinding behaviour in a platformer game is the glitch the “pathfinding character” experiences in order to get to the target. If anyone is planning on using the behaviour on a platformer you must experience this glitches.