Only reset headbob animation if it is playing when it is not supposed to

This commit is contained in:
2024-05-28 20:26:27 -07:00
parent c44be3fbfb
commit 02018a0105

View File

@ -313,8 +313,9 @@ func headbob_animation(moving):
# This code is extremely performant but it makes no sense. # This code is extremely performant but it makes no sense.
else: else:
HEADBOB_ANIMATION.play("RESET", 0.25) if HEADBOB_ANIMATION.is_playing():
HEADBOB_ANIMATION.speed_scale = 1 HEADBOB_ANIMATION.play("RESET", 0.25)
HEADBOB_ANIMATION.speed_scale = 1
func _process(delta): func _process(delta):