play_backwards not working as expected

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By LotusOrb

I have a roll animation that I want to be played in reverse when moving backwards.
I tried to use play_backwards instead of play however the animation doesn’t show up all.

I have also tried play(“animation”, -1, -1, true) to the same result. What could be causing this? Im using a state machine. Perhaps something in the transition state code.

Try it while moving forward.
Check if it is working

ramazan | 2022-01-22 14:44

yeah i tried, not sure what the problem is, ive never been able to get play backwards to work since i started. Maybe my animationplayer is bugged.

LotusOrb | 2022-01-22 17:20

Can you add part of the script?

ramazan | 2022-01-23 08:34

func heavy_attack():
attack_timer.stop()
attack_timer.start()
attack_finished = false
backswing_finished = false
if is_on_floor():
if Input.is_action_pressed(“heavy_attack”):
anim_player.play_backwards(“Attack3”)
if move_input_speed == 0:
velocity.x = velocity.x + 140 * facing

in the state machine pressing heavy attack switches state(with delta) to in enter_state
heavyattack() is called. When idling and pressing heavy attack the animation doesnt play, and flickers some anim. But when Im running and press heavy attack, weirdly the run animation plays backwards, and then the heavy attack anim plays backwards.

LotusOrb | 2022-01-26 20:08