move to apply_input_velocity on the subject

This commit is contained in:
2025-02-23 18:25:57 +09:00
parent ca63d4594c
commit 151a757e3e
13 changed files with 142 additions and 62 deletions
+11
View File
@@ -0,0 +1,11 @@
extends State
func process_physics(delta: float) -> State:
if not Main.is_server_or_predicting(subject.player_id, subject.client_prediction): return
var input_direction = %Input.direction if subject.is_on_floor() else Vector2.ZERO
subject.apply_input_velocity(delta, input_direction, subject.run_speed, subject.acceleration if subject.is_on_floor() else subject.air_deceleration)
if has_node("%Walk") and %Input.walk: return %Walk
return