How to Make Ramps: Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Chess123mate
1. Math.pi == 180 degrees, not 360. 2. Added another way to add angles to bricks [other than wedge -- use CFrame.fromAxisAngle]
>Mindraker
Line 9: Line 9:
Make one small square brick 1x1x1 size. Up on the toolbar click on the little icon for Hinges. This lets you click anywhere and make a hinge on that surface. Click on the side of your brick, and there will then be a small yellow peg sticking out of that side.  
Make one small square brick 1x1x1 size. Up on the toolbar click on the little icon for Hinges. This lets you click anywhere and make a hinge on that surface. Click on the side of your brick, and there will then be a small yellow peg sticking out of that side.  


That, right there, is a Hinge. All you have to do is make sure another brick is RIGHT ON THE PEG and it will make a hinge. Anchor that brick you just made, move it up a few studs and make a new brick touching the hinge. The two bricks should sit right next to each other so that you can't see the hinge anymore. When you save and play the game Online, the hinge will let the other brick swing downward, making a ramp.
That is a hinge. All you have to do is make sure another brick is right on the peg and it will make a hinge. Anchor that brick you just made, move it up a few studs and make a new brick touching the hinge. The two bricks should sit right next to each other so that you can't see the hinge anymore. When you save and play the game online, the hinge will let the other brick swing downward, making a ramp.




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


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


<pre>
<pre>
Line 20: Line 20:
</pre>
</pre>


Change the "(0,0,0)" to how many [http://en.wikipedia.org/wiki/Radian radians] (not degrees) you want it to rotate. Radians are a different way of saying how big an angle is. Instead of using [http://en.wikipedia.org/wiki/Degree_%28angle%29 degrees], they use a special numbering system that is best explained by a 10th grade Math teacher. You can use numbers between 1 and 0, which will work fine.
Change the "(0,0,0)" to how many [http://en.wikipedia.org/wiki/Radian radians] (not degrees) you want it to rotate. Instead of using [http://en.wikipedia.org/wiki/Degree_%28angle%29 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:
Play around with it, you can put the new number in either one of the three zeroes in the line, like this:
Line 28: Line 28:
</pre>
</pre>


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.
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.


Zuka: Try math.pi, its equal to 180 degrees. Then, try multiplying or dividing it to get different angles.
Zuka: Try math.pi, its equal to 180 degrees. Then, try multiplying or dividing it to get different angles.
Line 37: Line 37:
</pre>
</pre>
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.
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.
</pre>
 
[[Category:Building Tutorials]]
[[Category:Stubs]]

Revision as of 19:03, 2 July 2008

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


Using a Hinge

Make one small square brick 1x1x1 size. Up on the toolbar click on the little icon for Hinges. This lets you click anywhere and make a hinge on that surface. Click on the side of your brick, and there will then be a small yellow peg sticking out of that side.

That is a hinge. All you have to do is make sure another brick is right on the peg and it will make a hinge. Anchor that brick you just made, move it up a few studs and make a new brick touching the hinge. The two bricks should sit right next to each other so that you can't see the hinge anymore. When you save and play the game online, the hinge will let the other brick swing downward, making a ramp.


Using a CFrame

Make a brick, anchor it and name it "slope". Then open the Command Line 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.

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

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.