From 02018a0105dcbaa6c98842193d9a55c07a92eeeb Mon Sep 17 00:00:00 2001 From: Zakarya Date: Tue, 28 May 2024 20:26:27 -0700 Subject: [PATCH] Only reset headbob animation if it is playing when it is not supposed to --- addons/fpc/character.gd | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/fpc/character.gd b/addons/fpc/character.gd index b056e7d..e5ba68a 100644 --- a/addons/fpc/character.gd +++ b/addons/fpc/character.gd @@ -313,8 +313,9 @@ func headbob_animation(moving): # This code is extremely performant but it makes no sense. else: - HEADBOB_ANIMATION.play("RESET", 0.25) - HEADBOB_ANIMATION.speed_scale = 1 + if HEADBOB_ANIMATION.is_playing(): + HEADBOB_ANIMATION.play("RESET", 0.25) + HEADBOB_ANIMATION.speed_scale = 1 func _process(delta):