How to do Multi-Level collisions in 2D top down tilemaps?

Godot Version




I am making a top-down 2D RPG and right now i am working on the movement of the player and the interaction with the tilemap.

My question is related to the functioning of collisions regarding tilemaps. To be clear, i have this scene set up:

What i want to do, but i am not really sure about how to do it, is to modify the collisions in the cliff depending on which level the player is.

Right now i have two different collision layer set up, one for the bottom part of the cliff and the other for the top part of it
image image

And i am changing them so that if the player is on the bottom of the cliff it uses the first collision layer but on top of the cliff uses the second .

The problem is that this aplies to EVERY cliff, and what i want is that if the player is in the middle layer it uses the top collision for the cliff under it but the bottom collision for the cliff in the same layer.

Mi first thought is to asign the current layer in the player and changing it when the player uses the ladder but i am not sure about how to change the collisions of the tiles, since it is the same tile for every layer (thus the same collision layers).

Thank you so much