PcoWSkbVqDnWTu_dm2ix
Building a Hinged Door
Part 1 - Getting Started
Building a Hinged Door
Part 1 - Getting Started

Roblox’s physics system allows you to construct moving mechanisms like doors, rotating platforms, and even vehicles using constraints. For instance, a swinging door can be built using the HingeConstraint.

Door Setup

Start by creating parts for the door and its attachments. Attachments are where one object can connect to another. These attachments will later be used to connect the door to its frame with a hinge.

  1. Create two parts with names like Door and DoorFrame.

    alt

  2. Select DoorFrame. In the Properties, enable Anchored so it won’t move.

    alt

  3. In the Explorer, hover over DoorFrame and add a new Attachment. Repeat the same to add an attachment to the Door.

    alt

  4. Rename the attachments to indicate what they’re attached to, such as DoorAttachment and FrameAttachment.

    alt

Move the Attachments

New attachments are created in the center of a part. So they can work with the door, the two attachments need to be moved to face each other.

  1. To view constraints and attachments, in the Model tab, toggle on Constraint Details.

    alt

  2. In the Explorer, select FrameAttachment.

    alt

  3. Press F to focus on the attachment and zoom in if needed. Then, use the Move tool to position the attachment on the surface of the door frame, facing the door.

    It’s best to position attachments so they’re precisely aligned with one another. In this case, misaligned attachments may cause the door to swing incorrectly.

    For precise positioning, use Snap to Grid with increments appropriate for the size of the part. Alternatively, edit the attachment’s position in the Properties window.


  4. Repeat the same to move DoorAttachment. Your attachments should be positioned on the surface facing their counterpart.

Left: FrameAttachment / Right: DoorAttachment

Rotate the Attachments

The orientation of an attachment affects how a constraint can move. For the door, both attachments must be rotated so the hinge swings left and right, like those on a standard door.

  1. On the door frame, hover over FrameAttachment. Notice the yellow arrow. This arrow, the axis, determines the hinge’s rotation.

    alt

    Depending on the DoorFrame object, the axis may point in a different direction. For instance, a hinge added to the attachment shown above would pivot around the yellow arrow, like in the video below.


  2. For accurate rotation, turn on snapping in ModelSnap to Grid, and checking Rotate. Set the value to 90.

    alt

  3. Use the Rotate tool to orient both yellow attachments to point upwards. If your axes are already vertical, no action is needed.

    alt


Next Page Creating the Hinge