Building a Hinged Door
Part 2 - Creating the Hinge
Building a Hinged Door
Part 2 - Creating the Hinge

Adding the Constraint

Remember, constraints are a way of connecting two attachments to move in a specific way. This door will use a HingeConstraint, a common constraint that rotates objects along the axes of two attachments.

  1. Under DoorFrame, create a new HingeConstraint.


  2. In the constraint’s properties, find Attachment0. Click the empty box right of the property and then, in the Explorer, click DoorAttachment.

  3. Repeat the same process by connecting Attachment1 to FrameAttachment. The properties should appear as below.


  4. Test the project by walking into the door with your character.

    Issue: Parts not moving

    • Check anchoring. For instance, the door should not be anchored.
    • Make sure that the door’s motion isn’t blocked by terrain or nearby parts.
    Issue: Door not swinging as expected

Adjust the Door

The door is currently able to swing past the door frame. This can be fixed by adjusting the hinge limits.

  1. In the properties for HingeConstraint, find and toggle LimitsEnabled. When active, you can set the rotation limits of the hinge.


  2. To make sure this is oriented correctly, select DoorAttachment and use the rotate tool so the orange arrow points towards the door frame, like below.


    Axis Arrow Colors

    Remember that the yellow axis arrows affect the pivot of the hinge. Limits are affected by the orange axis arrows.

  3. Under the Limits section of the properties, both LowerAngle and UpperAngle to -90 and 90, respectively. This creates a range of motion like the image on the left.

  4. Test the door and notice that the hinge is now limited.

    Issue: Door limits don’t work as expected.
    It’s possible that the orange axis on an attachment isn’t correctly aligned. Select DoorAttachment, and make sure that a green plane with an arc points towards the door frame, the image below.

With the door complete, take some time to explore using hinge constraints in different situations, such as a trap door or a swinging axe trap.

Previous Page Getting Started