Creating a ladder
Roblox has a unique system that allows many different objects to function as ladders. In this recipe, we will be looking at three different methods to build a functional ladder. First, we will look at what the default truss object is and how it can be used as a climbable object. Next, we will create a rope with a part and then place an invisible truss over the top, allowing players to climb the rope. Lastly, we will use a primitive square part to build a realistic-looking and functioning ladder by using evenly spaced parts placed vertically.
How to do it…
We will first examine the truss part, which we will then use to create a climbable rope hanging from a wall. Next, we will create a ladder using blocks spaced apart vertically. Let’s dive in:
- To begin creating our first ladder, select the truss part provided in the
Chapter
1
folder. - Alternatively, open Toolbox to the Free Models section, search for
truss
, and then insert it onto the baseplate:
Figure 1.16: Truss part
- Resize the truss
14
studs along the y axis. - Next, anchor the truss by checking the Anchor checkbox located in the truss’s Properties box. As seen in Figure 1.17, you can see that players are able to climb the default truss without any modifications. This is the most basic type of Roblox ladder:
Figure 1.17: Player climbing a truss
- To begin your second style of ladder, create a tall cylinder part the width of a rope. In this example, the cylinder is
14
,0.3
,0.2
studs and the Orientation value is set to0, 0, -90
. We will be using this part to represent a rope that the players can climb up. - Next, create a large wall using a square part that is the same height as the rope – in this case,
14
studs tall. - Move the rope so that it is against the wall.
- Now, we will create a rounded elbow like what we learned in step 7 of the Creating wooden crates recipe. To do so, insert a sphere part scaled to the diameter of your rope part. Keeping the diameter of the sphere the same as the rope cylinder will help ensure that the sphere fits seamlessly into the cylinder.
- Move the sphere along the rope until it correctly rounds the top cap.
- Duplicate the rope part and line it up horizontally to the sphere at the top of the rope, completing the elbow, as shown in Figure 1.18:
Figure 1.18: Rope hanging over the edge of the wall
- Change the rope’s color to
150
,85
,85
. - Change the rope’s material to fabric.
- Next, move the truss from step 3 over the top of the rope so that the rope is inside of the truss.
- Change the transparency of the truss to
1
, making it invisible.Now, your rope will appear to be climbable, though the player will be climbing the invisible truss inside of the rope.
- Group the parts of the scene together and rename the model
Rope
. This completes the second method of creating the ladder:
Figure 1.19: Player climbing the rope
- For the third and final style of ladder, create a rectangle part. This example uses a
9.5
,1
,2
stud part. - Next, duplicate the part and move it up roughly
2
studs above the preceding part. Continue to repeat this step until you reach your desired ladder height. These evenly spaced parts function as ladder rungs, which enables players to climb them like a ladder. - Now, place vertical ends on both sides of the ladder using two square parts. Rescale the part just beyond the top of the ladder rungs.
- Select every other rung part on the ladder.
- Now, change the part color of the selected rungs to a slightly darker color tone than the other rungs. In this example, the lighter rungs are colored (
99
,95
,98
) and the darker rungs are colored (77
,74
,76
). This creates a contrast in the colors by alternating the lighter and darker tones.
This completes the third method of creating ladders as well as this recipe:
Figure 1.20: Player climbing a ladder made of square parts
You now have the understanding to create a variety of climbable surfaces.
There’s more…
Trusses can only be scaled in increments of 2
studs at a time. They have a minimum size of 2
x 2
x 2
and a maximum size of 64
studs.