From f189777141024bbad518c921587f15672b1982c2 Mon Sep 17 00:00:00 2001 From: Max-001 Date: Wed, 8 Jan 2025 20:07:39 +0100 Subject: Added check to not walk if velocity is 0 --- game/player/PlayerScript.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'game/player') diff --git a/game/player/PlayerScript.cpp b/game/player/PlayerScript.cpp index 57819c0..fadca9c 100644 --- a/game/player/PlayerScript.cpp +++ b/game/player/PlayerScript.cpp @@ -2,6 +2,7 @@ #include "../Config.h" #include "../enemy/BattleScript.h" + #include #include #include @@ -126,7 +127,8 @@ void PlayerScript::fixed_update(crepe::duration_t dt) { current_jetpack_sound = 0; } } else if (transform.position.y == 195) { - if (prev_anim != 0) { + Rigidbody & rb = this->get_components_by_name("player").front(); + if (prev_anim != 0 && rb.data.linear_velocity.x != 0) { for (Animator & anim : animators) { anim.active = true; anim.set_anim(0); -- cgit v1.2.3