crouching, walking and jumping

This commit is contained in:
Rendo 2025-12-03 21:50:14 +05:00
commit f312e0a4a6
9 changed files with 71 additions and 60 deletions

View file

@ -4,6 +4,8 @@ class_name PlayerMovement
@export var player: Player
@export var player_input: PlayerInput
@export var jump_velocity: float
var disabled: bool
func disable() -> void:
@ -24,3 +26,6 @@ func process_movement(max_speed: float,acceleration: float,deceleration: float,d
else:
player.velocity.x = move_toward(player.velocity.x, 0, deceleration*delta)
player.velocity.z = move_toward(player.velocity.z, 0, deceleration*delta)
func jump() -> void:
player.velocity.y = jump_velocity