How to flip a translation in the Animation Player?

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

I have a AnimationPlayer animating a Sprite node. In the AnimationPlayer there is a position track with two location keys set at x = 0 and x = 10. Effectively when I play the animation it translates the sprite from right to left. Is there a way to ‘h_flip’ this translation to make the translation go left to right (i.e x = 0 to x = -10) without making a new animation?

:bust_in_silhouette: Reply From: dustin

Use two AnimationPlayer nodes.

The first one will be for the regular animation and the second one
will be used for the forward and back movement
you wanted to do.
(flip only the first animation node using “flip_h = true/false” if you only want the right to left movement).

As long as you dont have a position track on the first animationplayer, the second one should be able to do the movement you want flawlessly.