I had the same issue and managed to solve it using a workaround.
EDIT I'm now using a different, better solution (in my opinion), see further down
The problem is the maxSlopeAngle does not work when using velocity interpolation to slow the movement gradually.
Why?
Because the slide only stops if the horizontal velocity is smaller than 0.01 (looked into the C++ code). So when reducing the velocity gradually, the gravity will always create a downward movement and make a horizontal movement greater than 0.01. If you set your horizontal velocity manually to 0, it will work (but then you lose the movement smoothing).
To fix that, I split the horizontal and vertical movement:
var is_on_floor #my own is_on_floor variable, since is_on_floor() won't work
#horizontal direction at max speed, 0 if stopping
var target_velocity = input_direction * target_speed
#interpolating horizontal velocity
velocity.y = 0.0
velocity = velocity.linear_interpolate(target_velocity , acceleration * delta)
velocity = move_and_slide(velocity, Vector3.UP, true, 4, deg2rad(max_slope_angle))
#apply gravity only, hack to fix issue with move and slide (sliding down slopes)
var result = move_and_collide(Vector3(0.0, gravity * delta, 0.0), true, true, true)
if result != null:
global_transform.origin.y += result.travel.y
is_on_floor = true
fall_speed = 0.0
#no collision detected, freefall
else:
is_on_floor = false
fall_speed += gravity * delta
global_transform.origin.y += fall_speed
Obviously the problem is I call two times the physics engine instead of once, but it seems to work, so that's good enough for now, while waiting for a fix.