PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience

Intro to Constraints – Revolving Doors

Intro to Constraints – Revolving Doors

Jul 27 2018, 3:59 PM PST 10 min

Constraints are a way of attaching two parts so they stay together when they move. They can be used to create moving mechanisms like doors, cars, windmills, and many other devices.

In this tutorial, we’ll make a revolving door using a hinge, one of the most common constraints.

Create the Door

For this door, we’ll use a basic block part that spins around a support piece.

  1. Create a small block and anchor it. This will be the base that the door spins on.
  1. Create a thin, long block and place it on top of the base; feel free to customize the material and color.
  1. Move the door part slightly above the base part. This will provide a better view under the door while you work on the hinge.

Attach the Door Hinge

With the parts created, we can add a constraint to allow the door to turn. First, let’s attach one side of a new hinge to the bottom of the door.

  1. Position your camera to see the bottom of the door.
  1. In the Model Tab, click on Create and select Hinge.

Notice that an attachment (green sphere) now follows your mouse. The attachment tells Studio where to start the constraint.

  1. Click on the bottom center of the door to place the first attachment (we’ll be adding two attachments in total).

Attach Hinge to the Base

Now let’s add a second attachment to complete the hinge.

  1. Move your camera so you can better see the small base part.
  1. Click on the top of the base to add the second attachment.

Notice that there's now a red line between the attachments — this is the actual constraint (hinge) which connects the two attachments.

Test the Revolving Door

Great! With the hinge completed, we can test out the door.

  1. Move the door back down to its intended in-game position, on top of base part.
  1. In the Home tab, click the small arrow below Play and select Play Here. This option lets you test the game from around the area you’re viewing.
  1. Make your player run into the door. It should revolve around on the base as shown above.

Now you see how constraints can be used to create simple moving contraptions. We encourage you to explore how hinges can be used to create more features like swinging doors, traps, and more!

Tags:
  • constraints
  • physics
  • hinge