var target_velocity := Vector3.ZERO
var noise: float = 0
-const squat_position := 0.6 # Position to which the camera moves when squatting
-const stand_position := 1.7 # Position to which the camera moves when standing
-const move_speed := 8.0 # Speed at which the camera moves from stand to squat and back
+const squat_scale := 0.4 # Position to which the camera moves when squatting
+const stand_scale := 1 # Position to which the camera moves when standing
+const squat_speed := 2.5 # Speed at which the camera moves from stand to squat and back
var is_squatting := false
var object_detected: Object = null
elif Input.is_action_just_released("squat"):
is_squatting = false
- if is_squatting and camera.position.y > squat_position:
- scale.y = scale.y * -move_speed * delta
- elif not is_squatting and camera.position.y < stand_position:
- scale.y = scale.y * move_speed * delta
+ if is_squatting and scale.y > squat_scale:
+ scale.y = scale.y - squat_speed * delta
+ elif not is_squatting and scale.y < stand_scale:
+ scale.y = scale.y + squat_speed * delta
if Input.is_action_pressed("squat"):
speed_mod = squating_speed_mod