Thank you both for your answer :)
I use 2 layers of tilemaps.
- One for the ground,
- the other for the elevation.
Adding a collision on the edge of the slope gives the illusion of climbing up if I add a round collision shape to the player.
However this only works for narrow slopes and won't work for larger ones (since the collision shape of the player won't come in contact with the edge of the slope)
The player movement code looks like this (KinematicBody2D):
var velocity = Vector2()
if Input.is_action_pressed("ui_right"):
velocity.x += speed * 1
velocity.y += speed * .5
if Input.is_action_pressed("ui_left"):
velocity.x -= speed * 1
velocity.y -= speed * .5
if Input.is_action_pressed("ui_down"):
velocity.x -= speed * 1
velocity.y += speed * .5
if Input.is_action_pressed("ui_up"):
velocity.x += speed * 1
velocity.y -= speed * .5
if velocity.length() > 0:
velocity = velocity.normalized()
move_and_slide(velocity * speed)
#I know this is stupid to multiply by speed so much, but this was temporary
It looks like this:

I have thought about using 3D but I'm not sure how the scaling would work to make sure every pixels are aligned and I wouldn't be able to use tilemaps to edit the landscape (or would I?)