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
+3 -5
View File
@@ -3,14 +3,12 @@ extends State
func process_physics(delta: float) -> State:
if not Main.is_server_or_predicting(subject.player_id, subject.client_prediction): return
var target_velocity = Vector3(0, subject.velocity.y, 0)
subject.velocity = subject.velocity.move_toward(target_velocity, subject.acceleration * delta)
subject.velocity += Main.gravity_velocity
subject.move_and_slide()
subject.apply_input_velocity(delta, Vector2.ZERO, 0.0, subject.acceleration)
if not subject.is_on_floor(): return %Fall
if has_node("%Lunge") and %Input.primary_interact: return %Lunge # TODO: Lunge attacks currently do nothing so Chasers can't move when they click in
var input_direction = %Input.direction
if input_direction.length() < 0.05: return
if has_node("%Walk") and %Input.walk: return %Walk
return %Run