crouching, walking and jumping
This commit is contained in:
parent
58ccdbce0e
commit
f312e0a4a6
9 changed files with 71 additions and 60 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue