Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice

[SOLVED]How do I flip a 2d character built using joints

Discussion in '2D' started by Shaka, Jan 21, 2018.

  1. Shaka

    Shaka

    Joined:
    Apr 24, 2010
    Posts:
    51
    I have a 2D active ragdoll character that is built using hingejoint2d:s between it's limbs.
    The hierarchy is like this:
    Hips
    UpperLeg
    LowerLeg

    Now I want the character to face the direction it's moving in, but I can't get it to work. I've tried rotating the Hips 180 degrees on the y-axis and tried scaling every part by -1 on the x-axis but in both cases the limbs get offset or the hinges wont work properly.
    What's the correct way to do this?

    Regards/Per
     
  2. Shaka

    Shaka

    Joined:
    Apr 24, 2010
    Posts:
    51
    I found a solution if anyone encounters the same problem:

    I flip every limb by changing the scale to -1 and then I rotate each hingejoint limit by 180 degrees on the y-axis.

    Regards/Per
     
    Cuttlas-U likes this.
unityunity