• Editor
  • Spine Flip x Problem

Related Discussions
...

Hey guys,

right now I want to flip a running Animation from right to left.

But when I put -1.0 scaling at my root bone the Animation looks deformed.

This is how my normal Animation looks like :

Bild entfernt wegen fehlender Unterstützung für HTTPS. | Trotzdem zeigen

When I flip the root bone with Scaling -1.0 :

Bild entfernt wegen fehlender Unterstützung für HTTPS. | Trotzdem zeigen

what am I doing wrong ?

I've (roughly) drawn your root bone's axes, X in black, Y in green:

Bild entfernt wegen fehlender Unterstützung für HTTPS. | Trotzdem zeigen

When you set scaleX to -1, the root bone X axis will point in the opposite direction. This means everything is flipped over the Y (green line in the screenshot) axis.

Another way to say you want to make your character face left/right is that you want to flip it over the Y world axis. To do this you can leave the root bone rotation at 0 so the root bone X axis aligns with the X world axis, then scaleX -1 will do what you want.

Flipping the skeleton over a world axis and setting the root bone scaleX to -1 are almost the same thing, but they do differ slightly. If you have bones that don't inherit scale, flipping by setting scale X or Y to -1 will not flip those bones. At runtime the skeleton has a flipX/Y property which is like negative scale, but affects all bones, even those that don't inherit scale. We plan to expose this property in the editor.

It's also worth mentioning that it's pretty much always best NOT to use the root bone as a hip bone.

If you look at the Spineboy projects in the examples folder you will quickly notice that in the Spineboy project the root bone has been renamed to "Hip". But in the Spineboy-mesh project the root bone is still there and instead another bone has been added as the hip bone. This is because the Spineboy-mesh project uses Inverse Kinematics. Without the root bone in the Spineboy-mesh project the IK would need to be constrained to the hip bone and would move along with the hip bone making it pretty tough to work with. With the root bone in place, the IK constraints can be parented to the root and won't move together with the hip bone.

Additionally the root bone is often used to place your skeleton at runtime or to get the location. If you have keys on the root bone this can complicate things a bit.