Building a Hinged Platform

Building a Hinged Platform

10 min

In the articles/Creating Your First Game|Making a Basic Platformer tutorial, you explored Roblox Studio and you designed a basic obstacle course. In this tutorial, you’ll create a tilting, see-sawing platform that players must overcome.

Creating the Support and Platform

The hinged platform will tip back and forth as the player walks on it, but first it needs an anchored support or it will fall down into space.

Create the Support

The support can be a simple block, anchored in place.

  1. Somewhere between two other platforms, create a small block.
  1. Anchor the new part in space.

Create the Platform

Next, create the platform that will tip back and forth. Make sure it’s centered left-to-right with the support part so that the final assembly balances. Also consider articles/Making Your Obby Colorful|applying a different color so that players recognize it’s not a typical platform.

Name the Parts

As you design bigger and better games, it’s a good idea to enter custom names for important parts so they’re easy to find in the Explorer window.

  1. In the game editor window, select the platform support that you created.
  2. In the Explorer window, right-click the part’s name and select Rename.
  3. Enter in PlatformSupport.
  1. Back in the game editor window, select the platform part itself. In the Explorer window, rename the part to HingePlatform.

Attaching the Parts

Now that you have two parts for the hinged platform, it’s time to attach them. In Roblox, constraints attach two parts together and let you create special behaviors for them.

  1. To get a better view of things before you add the constraint, move the platform away from the support by a few studs.
  1. Make sure that you’re viewing the Model tab.
  2. In the Constraints section, click the small arrow below Create and select Hinge.
  1. Move your mouse pointer into the game editor window and hover over the PlatformSupport part. Move your mouse until the attachment (green sphere) is centered on the surface facing the platform.
  1. Click the mouse button to add it.
  2. Adjust the camera view so that you can see the thin side of the platform (HingePlatform) located near the support part.
  1. Carefully move the mouse until the second attachment is positioned across from the first attachment, then click the mouse button to add it.

Changing the Mass

In Roblox, a part’s mass is internally calculated based on its size and density. If the hinged platform’s mass is too low, it will move too quickly and drop players off into empty space before they can reach the other side. If its mass is too high, the platform will move too slowly and players will just walk across it like a normal anchored part.

You can change the platform’s mass — regardless of its size — by adjusting its Density property.

  1. Select the HingePlatform part in the game editor window, or select it from the Explorer window.
  2. In the Properties window, find the Part section and look for a row named CustomPhysicalProperties (if necessary, expand the Part section by clicking the small arrow next to its name).
  1. Click the small checkbox inside its row.
  1. For the Density property, type in a higher value like 5.

Finishing Up

To finish up, move the HingePlatform part back against the PlatformSupport part.

Now press the Play button to test. When you jump onto the platform, it should tip back and forth like a see-saw. Your goal is to balance and move across it without being tipped off into empty space.

Now your game has a dynamic obstacle which challenges players to balance with greater control. Where next? Check out the tutorials below for more ideas and inspiration.

  • basics
  • studio
  • obby
  • constraints