How to Make Ramps: Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Icblud
m Text replacement - "<SyntaxHighlight code="lua">" to "<syntaxhighlight lang="lua">"
 
(92 intermediate revisions by 21 users not shown)
Line 1: Line 1:
There are two ways to make Ramps which people can walk up or drive up.
{{CatUp|Tutorials}}
 
{{LowQualityMedia|reason=The hinge method should be reproduced (in 2008) to get a better screenshot of the end result.}}
{{LacksMedia|reason=The Hinge method is a very dense bullet list, there should be more images along the way.}}
__TOC__
== Introduction ==
There are three ways you can make ramps. You can either use a Hinge or a CFrame to edit rotation, or you can simply insert a WedgePart
<!-----------------------------------------------------------------------------------
If you're editing this to post about the Wedge, you'd better not waste your time. A Wedge is NOT a ramp, it's still a square brick. These are ramps that make real ramps, a wedge does not do that. I've already warned that the next one to post about a wedge gets a ban. So don't do it. -------------------------------------------------------------------------------->


==Using a Hinge==
==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.  
* In [[Roblox Studio|Roblox studio]], click Workspace.
 
* Click Insert > Object > Part
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.
* [[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.


[[Image:Ramp.JPG]]


==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 [[Scripting#Fundamentals|Command Bar]] and type this in:


<pre>
<syntaxhighlight lang="lua">
game.Workspace.slope.CFrame=CFrame.fromEulerAnglesXYZ(0,0,0)
s = game.Workspace.slope; s.CFrame = CFrame.Angles(0,0,0) + s.CFrame.p
</pre>
</syntaxhighlight>


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.


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:


<pre>
<syntaxhighlight lang="lua">
game.Workspace.slope.CFrame=CFrame.fromEulerAnglesXYZ(0.5,0.9,0.3)
s = game.Workspace.slope; s.CFrame = CFrame.Angles(math.rad(30), math.rad(45), 0) + s.CFrame.p
</pre>
</syntaxhighlight>
 
Which will make it rotate in all kinds of directions.
 
Also, you can use
<syntaxhighlight lang="lua">
s = game.Workspace.slope; s.CFrame = CFrame.fromAxisAngle(Vector3.new(0,0,1), math.pi/2) + s.CFrame.p
</syntaxhighlight>
 
* Change the <syntaxhighlight lang="lua">Vector3.new(0,0,1)</syntaxhighlight> to the line to rotate around. For example, if you want to rotate the brick around the z axis, use <syntaxhighlight lang="lua">Vector3.new(0,0,1)</syntaxhighlight>.  If you want to rotate the brick around the y axis, use <syntaxhighlight lang="lua">Vector3.new(0,1,0)</syntaxhighlight>.  If you want to rotate the brick around the x = z line, use <syntaxhighlight lang="lua">Vector3.new(1,0,1)</syntaxhighlight>.
* Lastly, change math.pi/2 to the value in radians you wish to angle the brick by.  This can be a constant, a variable, up to you.


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.
==Using a WedgePart==


* In [[Studio|Roblox studio]], click Workspace.
* Click Insert > Object > WedgePart
* It's as simple as that.  You now have a WedgePart that acts like a ramp.
[[Image:WedgePart.jpg]]


== See Also ==


[[Radians]]


==Using a Wedge==
[[Function Dump/Mathematical Functions]]


Make a brick. Click on the brick and go to insert, object, specialmesh. The birck should be a weird circle shape. Open the explorer and properties windows. In the explorer, go to the brick you made and click on the + sign next to it. Select the mesh. In the properties window you should see MeshID, Mesh Type, etc. To change the shape, click on the arrow next to the name of MeshType (it should currently say "Head") and select wedge. your brick should be a nice looking ramp. If you want people to walk on it, dont stretch it out because it is half invisible and walking into one big ramp like that is like walking into a giant brick. To let people walk on it you need to make many many small ones and build them next to each other like you would build stairs. You can stretch it as big as you want if you are making a decoration! You can even try the other mesh types and really make an abstract design!
[[Category:Building Tutorials]]
[[Category:Scripting Tutorials]]

Latest revision as of 05:10, 27 April 2023

Template:LowQualityMedia Template:LacksMedia

Introduction

There are three ways you can make ramps. You can either use a Hinge or a CFrame to edit rotation, or you can simply insert a WedgePart

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:

s = game.Workspace.slope; s.CFrame = CFrame.Angles(0,0,0) + s.CFrame.p

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.

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

s = game.Workspace.slope; s.CFrame = CFrame.Angles(math.rad(30), math.rad(45), 0) + s.CFrame.p

Which will make it rotate in all kinds of directions.

Also, you can use

s = game.Workspace.slope; s.CFrame = CFrame.fromAxisAngle(Vector3.new(0,0,1), math.pi/2) + s.CFrame.p
  • Change the
    Vector3.new(0,0,1)
    
    to the line to rotate around. For example, if you want to rotate the brick around the z axis, use
    Vector3.new(0,0,1)
    
    . If you want to rotate the brick around the y axis, use
    Vector3.new(0,1,0)
    
    . If you want to rotate the brick around the x = z line, use
    Vector3.new(1,0,1)
    
    .
  • Lastly, change math.pi/2 to the value in radians you wish to angle the brick by. This can be a constant, a variable, up to you.

Using a WedgePart

  • In Roblox studio, click Workspace.
  • Click Insert > Object > WedgePart
  • It's as simple as that. You now have a WedgePart that acts like a ramp.

See Also

Radians

Function Dump/Mathematical Functions