move_and_slide to move my player model (kinematic body) around. I want to prevent it from falling off edges when it's crouching. Is there a simple way to do that?
The collision shape is a capsule with a cylinder at the bottom (so that the player can slide over small things, but doesn't slide off edges).
func _physics_process(delta : float) -> void:
# more stuff
func process_movement(delta : float) -> void:
# basically the movement code from the Godot FPS tutorial:
hvel = hvel.linear_interpolate(target, accel * delta)
vel.x = hvel.x
vel.z = hvel.z
vel = move_and_slide(vel, Vector3(0, 1, 0), 0.05, 4, deg2rad(MAX_SLOPE_ANGLE))
# some more stuff