14 lines
443 B
GDScript
14 lines
443 B
GDScript
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 input_direction.length() < 0.05: return %Idle
|
|
|
|
subject.apply_input_velocity(delta, input_direction, subject.run_speed, subject.acceleration)
|
|
|
|
if has_node("%Walk") and %Input.walk: return %Walk
|
|
if not subject.is_on_floor(): return %Fall
|
|
return
|