FPS Controller
This commit is contained in:
10
demo/assets/scripts/player/states/grounded_state.gd
Normal file
10
demo/assets/scripts/player/states/grounded_state.gd
Normal file
@@ -0,0 +1,10 @@
|
||||
extends PlayerState
|
||||
|
||||
|
||||
func _on_grounded_state_physics_processing(delta: float) -> void:
|
||||
if Input.is_action_just_pressed("jump") and player_controller.is_on_floor():
|
||||
player_controller.jump()
|
||||
player_controller.state_chart.send_event("onAirborne")
|
||||
|
||||
if not player_controller.is_on_floor():
|
||||
player_controller.state_chart.send_event("onAirborne")
|
||||
Reference in New Issue
Block a user