One thing that helped in my case, is not applying x-z movements when not floored. This would still need some fine-tuning to work properly, but it mostly solves the issue. For me it makes it also easier to jump while running around.
Here an example. Instead of:
velocity.y -= delta * GRAVITY
velocity.x = direction.x * MAX_SPEED
velocity.z = direction.z * MAX_SPEED
velocity = move_and_slide(velocity, Vector3.UP, true)
I do:
velocity.y -= delta * GRAVITY
if is_on_floor():
velocity.x = direction.x * MAX_SPEED
velocity.z = direction.z * MAX_SPEED
velocity = move_and_slide(velocity, Vector3.UP, true)
This avoids applying the x and z movements when you're up a steep slope, thus stopping the "force" the object is doing against it, which causes the sliding. It also keeps the object better grounded instead of flying around, so that jumping is easier. Remaining problems:
- The object will still slightly go up a slope, then bounce back.
- There is some jitter when pushing against steep slopes.