From 04825f467ded573b10cdfcfa3d19e8c089d870e6 Mon Sep 17 00:00:00 2001 From: yuni Date: Sun, 17 Nov 2024 02:24:10 +0100 Subject: [PATCH] less jumpy gforce on acceleration --- src/actor.rs | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/actor.rs b/src/actor.rs index 759db97..fc67e2c 100644 --- a/src/actor.rs +++ b/src/actor.rs @@ -47,21 +47,23 @@ impl Plugin for ActorPlugin { handle_wants_lookat.run_if(game_running).run_if(alive), ), ); + app.add_systems( + PreUpdate, + handle_wants_acceleration + .run_if(game_running) + .run_if(alive) + .after(PhysicsSet::Sync) + .after(sync::position_to_transform), + ); + app.add_systems( PostUpdate, - ( - handle_wants_acceleration - .run_if(game_running) - .run_if(alive) - .after(PhysicsSet::Sync) - .after(sync::position_to_transform), - handle_gforce - .run_if(game_running) - .run_if(alive) - .after(PhysicsSet::Sync) - .after(sync::position_to_transform) - .after(handle_wants_acceleration), - ), + handle_gforce + .run_if(game_running) + .run_if(alive) + .after(PhysicsSet::Sync) + .after(sync::position_to_transform) + .after(handle_wants_acceleration), ); app.add_systems( Update,