# Godot Version

v4.2.1.stable.official [b09f793f5]

# Question

I want my player to keep sliding down, but when player reaches more straight ground, he suddenly stops. I have no idea how to program it so that he would keep going, but the speed will slow down every time. Any ideas?

## Code

`SPEED_MULTIPLY`

is 1.0 most of the time, so count it like that, `speed`

could be either 3.0, 5.0 or 8.0, but because we’re crouching to slide, it is 3.0

```
# Get the input direction and handle the movement/deceleration.
var input_dir = Input.get_vector("left", "right", "forward", "backward")
var direction = (head.transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
if is_on_floor():
if SPEED_MULTIPLY > 1.0: SPEED_MULTIPLY -= 0.05
if SPEED_MULTIPLY < 1.0: SPEED_MULTIPLY += 0.005
if direction:
velocity.x = direction.x * speed * SPEED_MULTIPLY
velocity.z = direction.z * speed * SPEED_MULTIPLY
else:
velocity.x = lerp(velocity.x, direction.x * speed * SPEED_MULTIPLY, delta * 7.0)
velocity.z = lerp(velocity.z, direction.z * speed * SPEED_MULTIPLY, delta * 7.0)
else:
velocity.x = lerp(velocity.x, direction.x * speed * SPEED_MULTIPLY, delta * 3.0)
velocity.z = lerp(velocity.z, direction.z * speed * SPEED_MULTIPLY, delta * 3.0)
move_and_slide()
```