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 Door bolts out of its Hinge Joint past a certain point

Discussion in 'Physics' started by PascalTheDog, Nov 21, 2022.

  1. PascalTheDog

    PascalTheDog

    Joined:
    Mar 16, 2015
    Posts:
    86
    I'm trying to create a simple physics-based door system, and I feel like I'm missing something about hinge joints.

    I have a very simple setup for the door (cf: fig. 1). The PhysicalDoor is simply an empty object that serves as a root parent, to keep things tidy. The Hinge is a visual representation of the door's hinge; it doesn't have a Collider, just a kinematic RigidBody. The Door is well, the actual door — a simple cube with a Box Collider, a non-kinematic RigidBody and a Hinge Joint with the Hinge object referenced as the connected body.

    Overall, the door *does* behave as expected. It rotates around the Hinge when a force is applied to it with a bump of a kinematic sphere and stops rotating when it reaches the specified limits. But when the sphere forces its way ever so slightly beyond a critical point, the system breaks and the door bolts out of its hinge. That's regardless of whether there are limits (cf: fig. 2) or not (cf: fig. 3).

    Is that behaviour expected? Is there a way to ensure a door never bolts out of its hinge, not matter what kind of force affects it?
     

    Attached Files: