2d pathfinding on layers

Hello guys,

I was wondering if it was possible to make the pathfinding work on each layer individually?

I purchased the pro version and i wanted to make it so when the player walks on a specific layer the collisions for that layer will work but the other layers below and above wont.

This way i can make the player able to walk in a mountain on a mountain and under a mountain without the collisions colliding and making the player not able to walk in the mountain due to the collisions on and under.

Thanks in advanced!!

Hi

It sounds perhaps like you want to put your obstacles on different layers, and then create separate graphs for each layer?

Yes indeed and have them work independently, so when on floor1 the collisions from the ground floor don’t interfere with the floor1so you would be able to walk over the collisions of the ground floor when on floor1

Hi

There’s no built-in way of doing this.
You would want to use a layered grid graph, but there’s no support at the moment for generating it based on a layered tilemap, I’m afraid.
You might be able to hack the source code if it.
Alternatively, I suppose you could create a corresponding world with 3D colliders and scan that using a layered grid graph. That’d work, but it might be a bit clunky.

Is it possible to have them activated or deactivated based on the layer the player is on?