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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

My Character flipping wrong

Discussion in '2D' started by ronyaroo, Jul 8, 2022.

  1. ronyaroo

    ronyaroo

    Joined:
    Jul 7, 2022
    Posts:
    7
  2. PuppyPolice

    PuppyPolice

    Joined:
    Oct 27, 2017
    Posts:
    116
  3. ronyaroo

    ronyaroo

    Joined:
    Jul 7, 2022
    Posts:
    7
    Wich Pivot point ihave so much for hands and body, head
     

    Attached Files:

  4. Cornysam

    Cornysam

    Joined:
    Feb 8, 2018
    Posts:
    1,353
    If it isnt the individual sprite's pivot point being the issue, it could be that your children objects of the gameobject being flipped isnt centered. So, find the object with the script that handles the flipping and then make sure the children object's (the one composed of sprites) transform position is set properly.
     
  5. ronyaroo

    ronyaroo

    Joined:
    Jul 7, 2022
    Posts:
    7
    This Is My character look
     

    Attached Files:

  6. Cornysam

    Cornysam

    Joined:
    Feb 8, 2018
    Posts:
    1,353
    Yup. As I thought
    upload_2022-7-8_9-35-21.png
    The Child object "Burger_Guy" under "Burger_GuyBigger" (The ultimate parent object) is off-center from "Burger_GuyBigger"
     

    Attached Files:

  7. ronyaroo

    ronyaroo

    Joined:
    Jul 7, 2022
    Posts:
    7
    So How To Solve This My Brain Is Small
     
  8. Cornysam

    Cornysam

    Joined:
    Feb 8, 2018
    Posts:
    1,353
    Your brain is not small. Move the transform position (most likely the X) to the left of the Burger_Guy until that little circle is center with its parent. Test the flip after each move and you will get it close. Note, you may have to change your collider's position depending on what object it is on, but that is after you get the sprite centered.
     
  9. ronyaroo

    ronyaroo

    Joined:
    Jul 7, 2022
    Posts:
    7
    upload_2022-7-8_17-48-6.png Like This ? It Didnt Work
     
  10. Cornysam

    Cornysam

    Joined:
    Feb 8, 2018
    Posts:
    1,353
    Test it. Make the character flip in your game and see how off it is
     
  11. ronyaroo

    ronyaroo

    Joined:
    Jul 7, 2022
    Posts:
    7
    See ?
     

    Attached Files:

    • saf.gif
      saf.gif
      File size:
      704.3 KB
      Views:
      128
  12. Cornysam

    Cornysam

    Joined:
    Feb 8, 2018
    Posts:
    1,353
    Continue checking all of the children objects. Continue testing. Your objects are not centered to what the script is flipping. I cannot continue to help you. You need to make sure all of the children objects are centered with the object that has the Flip script on it. Test test test test
     
  13. ronyaroo

    ronyaroo

    Joined:
    Jul 7, 2022
    Posts:
    7
    Thx It Worked But Now Why This Thing Is Happening this only happiness when ipress play and this is my hierachy upload_2022-7-8_18-18-29.png upload_2022-7-8_18-18-34.png
     
  14. Cornysam

    Cornysam

    Joined:
    Feb 8, 2018
    Posts:
    1,353
    It may be worth creating another child called Graphics under Burger_Guy object and adding all of the body part children to that one. So your hierarchy will be: Burger_GuyBigger > Burger_Guy > Graphics > Leg, Stomach, Head, etc.

    Then line up the character properly in the Graphics object you just created. Then make sure Burger_guy and Graphics are centered and you should be good.