Fixed double-crouching

This commit is contained in:
Rendo 2025-12-03 23:57:09 +05:00
commit c1548e5451
5 changed files with 12 additions and 15 deletions

View file

@ -2,6 +2,7 @@ extends State
@export var player: Player
@export var player_movement: PlayerMovement
@export var player_input: PlayerInput
@export var max_speed: float = 5.0
@export var acceleration: float
@export var weapon_system: WeaponSystem
@ -18,7 +19,12 @@ func physics_update(delta: float) -> void:
if not is_multiplayer_authority():
return
if player.is_on_floor():
transition.emit("Stand")
if player_input.compressed_states & PlayerInput.CROUCH:
transition.emit("Crouch")
elif player_input.compressed_states & PlayerInput.WALK:
transition.emit("Walk")
else:
transition.emit("Stand")
land_sound.multiplayer_play()
player.velocity += player.get_gravity() * delta