Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Hinge Joint Object Wraps Rotation Limits

Discussion in 'Physics' started by ruthvik_konda, May 2, 2024.

  1. ruthvik_konda

    ruthvik_konda

    Joined:
    Oct 26, 2022
    Posts:
    3
    Hi everyone,

    I've created a hinge joint for a notebook cover and a notebook. The notebook cover (which has the hinge joint) has the limits 0 and -200. However after the testing I've done, it looks like when the limit is set past -180 or 180, the notebook cover, instead of slightly bouncing back or resting at -200, wraps back around to 0 degrees and does this loop over and over.

    I've tried changing the rigidbody collision detection for both objects, and I've tried changing the notebook's movement type in the XR grab interactable. Neither changed anything. I've attached some screenshots and videos to help visualize the problem. Any help is greatly appreciated. Thanks.

    Screenshots:
    https://imgur.com/a/Dja1ZKI

    Video:


    Note: This is my first forum post. Please let me know if I did anything wrong.
     
  2. ArachnidAnimal

    ArachnidAnimal

    Joined:
    Mar 3, 2015
    Posts:
    1,936
    When I try setting up a hinge joint with limits [-200, 0] I get a warning: "Min and Max limits must be in the range [-180, 180]."
    Maybe you could adjust the parent's rotation +/- 20 degrees to compensate for this warning.
     
  3. ruthvik_konda

    ruthvik_konda

    Joined:
    Oct 26, 2022
    Posts:
    3
    To compensate for that warning, I enabled "Extended Limits" in the inspector. It's the last screenshot in the imgur link. Shouldn't hinge joints regardless work past 180 degrees?