player.model.global_rotation.y = lerp_angle(
player.model.global_rotation.y,
skin_target_angle,
- PlayerVariables.rotation_speed * delta
+ player.rotation_speed * delta
)
# lean into player momentum just a little bit
) * player.velocity.length() * 0.08,
-skin_lean_limit, skin_lean_limit
),
- PlayerVariables.rotation_speed * delta * 0.25
+ player.rotation_speed * delta * 0.25
)
)
# save off last movement direction
- if movement_vector.length() > 0.2:
+ if movement_vector.length() > 0.01:
player.last_movement_vector = movement_vector
# if we're not stuck, then it's okay to set the velocity
player.ground_slope_input = (PI / 2) - player.velocity.angle_to(player.floor_normal)
var new_velocity = player.velocity.move_toward(
movement_vector * (speed + player.ground_slope_input * speed),
- PlayerVariables.acceleration * delta
+ player.acceleration * delta
)
return new_velocity