Files
godot-demo-holes/demo/assets/scripts/player/states/crouching_state.gd
2025-11-13 16:33:08 -05:00

13 lines
413 B
GDScript

extends PlayerState
func _on_crouching_state_physics_processing(delta: float) -> void:
player_controller.camera.update_camera_height(delta, -1)
if not Input.is_action_pressed("crouch") and player_controller.is_on_floor() and not player_controller.crouch_check.is_colliding():
player_controller.state_chart.send_event("onStanding")
func _on_crouching_state_entered() -> void:
player_controller.crouch()