Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

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

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

Thread Status:
Not open for further replies.
  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.
  3. freezewin

    freezewin

    Joined:
    Sep 27, 2022
    Posts:
    1
    How did you rotate Joint?
     
  4. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    8,545
    Please don't necro super old posts like this. The above user hasn't posted in over 4 years.

    If you have a question then please create your own thread.

    Read what they put in the post for their solution. It states exactly what they did.
     
Thread Status:
Not open for further replies.
unityunity