How to flip a Skeleton (bone) animation horizontally?

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

I’ve made a cutout animation with a skeleton and polygons, it has run and walk but its only to the right.How do i turn it left when i press my left key?. I’ve tried the

self.set_scale(Vector2D(-1,1))

but it makes it glitch. Anyone has ideas?

Also for future reference it’s Vector2() not Vector2D()

StoneForged | 2019-07-11 00:06

:bust_in_silhouette: Reply From: StoneForged

self.flip_h = true
This should do the trick

:bust_in_silhouette: Reply From: triangledot

I had the same problem, and I found that I had to put the skeleton and the polygons together into a Node2D, then scale as you’re doing now.

:bust_in_silhouette: Reply From: garywayne

Flipping the animated polygon is rather easy using the suggestions but one thing to also consider about flipping animations or even animated sprite sheets, if the animation has arms and it is carrying something in the right hand when the animation is flipped, magically the something is now in the left hand. the unexposed or partially exposed arm should be exposed when the direction is changed and the item should not change hands.