How to Make Ramps: Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Mindraker
→‎Using a CFrame: better link
>Mindraker
Line 8: Line 8:
==Using a Hinge==
==Using a Hinge==


Make one small square brick 1x1x1 size. <br>
* In [[Roblox Studio|Roblox studio]], click Workspace.
Up on the toolbar click on the little icon for Hinges. This lets you click anywhere and make a hinge on that surface.<br>
* Click Insert > Object > Part
Click on the '''side''' (not the top) of your brick, and there will now be a small yellow peg sticking out of that side of your 1x1x1 brick.<br>
* [[Resize]] the newly brick so that it is one unit wide, one unit long, and as tall as you want.
Put the hinge aside for the moment.<br>
* Click the [[Weld]] option in your [[Toolbar]] (it has an X in a square).
* Click ONE side of your tall brick with the weld option.
* Click Workspace.
* Click Insert > Object > Part
* [[Resize]] this newly created brick so it is one unit wide, one unit long, and one unit tall.
* Click the [[Weld]] option in your [[Toolbar]].
* Click the side of this brick that is facing the welded side of the TALL brick with the weld option.  You should have two welded faces facing each other.
* Select the [[Drag]] option in your [[Toolbar]].
* Place the small brick near the top of the tall tower.
* Select the [[Hinge]] option on your [[Toolbar]]
* Click the small brick.  A yellow dot should be protruding from it.
* Click Workspace.
* Click Insert > Object > Part
* [[Resize]] this newly created brick to a long, flat, rectangle.
* [[Drag]] this newly created rectangle so that you can't see the yellow dot.
* Test your game.  If you did this correctly, your bar should fall downwards.


Create a NEW brick, which will look like a wall.<br>
[[Image:Ramp.JPG]]
Stretch that wall brick 10 units high.<br>
 
Stick the hinge "into" the wall brick.  The hinge is going to be the "support" for the ramp.  The higher the hinge is in the wall, the greater the angle of the ramp will be.<br>
 
Create a NEW brick, which will look like a long, flat, thin rectangle.  This will be the ramp.  Move one end over the 1x1x1 hinge.  The other end will be sticking out into space.  When you save and play the game online, the hinge will let the other brick swing downward, making a ramp.  When the ramp comes into contact with the hinge, the hinge will realign itself with the angle of the ramp.


==Using a CFrame==
==Using a CFrame==

Revision as of 16:03, 23 September 2008

Introduction

There are two ways you can make ramps. You can either use a Hinge or a CFrame to edit rotation.

Using a Hinge

  • In Roblox studio, click Workspace.
  • Click Insert > Object > Part
  • Resize the newly brick so that it is one unit wide, one unit long, and as tall as you want.
  • Click the Weld option in your Toolbar (it has an X in a square).
  • Click ONE side of your tall brick with the weld option.
  • Click Workspace.
  • Click Insert > Object > Part
  • Resize this newly created brick so it is one unit wide, one unit long, and one unit tall.
  • Click the Weld option in your Toolbar.
  • Click the side of this brick that is facing the welded side of the TALL brick with the weld option. You should have two welded faces facing each other.
  • Select the Drag option in your Toolbar.
  • Place the small brick near the top of the tall tower.
  • Select the Hinge option on your Toolbar
  • Click the small brick. A yellow dot should be protruding from it.
  • Click Workspace.
  • Click Insert > Object > Part
  • Resize this newly created brick to a long, flat, rectangle.
  • Drag this newly created rectangle so that you can't see the yellow dot.
  • Test your game. If you did this correctly, your bar should fall downwards.

Using a CFrame

Make a brick, anchor it and name it "slope". Then open the Command Bar and type this in:

game.Workspace.slope.CFrame=CFrame.fromEulerAnglesXYZ(0,0,0)

Change the "(0,0,0)" to how many radians (not degrees) you want it to rotate. Instead of using degrees, they use radians, which are a different way of saying how big an angle is. You can use numbers between 1 and 0, which will work fine.

Play around with it, you can put the new number in either one of the three zeroes in the line, like this:

game.Workspace.slope.CFrame=CFrame.fromEulerAnglesXYZ(0.5,0.9,0.3)

Which will make it rotate in all kinds of directions. You can also press enter a couple of times and it will make the brick rotate again, so you can rotate it farther.

Also, you can use

brick.CFrame=CFrame.new(Vector3.new(0,100,0)) * CFrame.fromAxisAngle(Vector3.new(0,0,1), math.pi/2)

Change the 1st Vector3.new() to change the position of the brick, and the 2nd one: change which one(s) are 1 rather than 0. Make sure that at least one of the values are non-zero. Change the 2nd value to the radians you wish to angle the brick by.

Tips

Try math.pi, its equal to 180 degrees. Then, try multiplying or dividing it to get different angles.

See Also

Radians