How to Make Ramps: Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Mattbru77
m a small corection changed there is 2 types to are
m Text replacement - "<SyntaxHighlight code="lua">" to "<syntaxhighlight lang="lua">"
 
(101 intermediate revisions by 23 users not shown)
Line 1: Line 1:
This will tell you how to make ramps.
{{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. -------------------------------------------------------------------------------->


==Introduction==
==Using a Hinge==
There are 2 types of ramps, one is easy and looks better IMO, one is harder and doesn't look right as it doesn't go in place well. The methods are: Invisible Stair Mesh Ramp (I thought of this name, but I got the inspiration to use this from Are92's Snowbound/Narrows) and the other is called um... I dunno, It uses the command toolbar.


==The Hard Way==
* In [[Roblox Studio|Roblox studio]], click Workspace.
Make a brick, anchor it and name it "slope". Then open the command toolbar and paste this in:
* Click Insert > Object > Part
<pre>
* [[Resize]] the newly brick so that it is one unit wide, one unit long, and as tall as you want.
game.Workspace.slope.CFrame=CFrame.fromEulerAnglesXYZ(0,0,0)</pre>
* Click the [[Weld]] option in your [[Toolbar]] (it has an X in a square).
Change the "(0,0,0)" to how many [http://en.wikipedia.org/wiki/Radian radians] (not degrees) you want it to rotate.
* 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.


'''Due the bug found in "fromEulerAngles", it was spelled wrong; so I made a little edit in the script.'''
[[Image:Ramp.JPG]]


[[User:ZacharyBoyCool|ZBC]] 04:10, 16 February 2008 (CST)
==Using a CFrame==


Make a brick, anchor it and name it "slope". Then open the [[Scripting#Fundamentals|Command Bar]] and type this in:


There are also several tools to do this; mine is called the "Rotator", and it should show up if you search for it. ;) [[User:Jediknightkrazy|Jedi Knight Krazy]] 12:13, 2 April 2008 (CDT)
<syntaxhighlight lang="lua">
s = game.Workspace.slope; s.CFrame = CFrame.Angles(0,0,0) + s.CFrame.p
</syntaxhighlight>


You can also paste into the command bar:
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.


    game.Workspace.Brick.CFrame = game.Workspace.Brick.CFrame * CFrame.fromAxisAngle(Vector3.new(1, 0, 0), 0.1)
Play around with it, you can put the new number in either one of the three zeroes in the line, like this:


That will rotate the brick slightly upward. Repeat until you get the desired angle. =D --[[User:JustinP231|JustinP231]] 13:35, 3 April 2008 (CDT)
<syntaxhighlight lang="lua">
s = game.Workspace.slope; s.CFrame = CFrame.Angles(math.rad(30), math.rad(45), 0) + s.CFrame.p
</syntaxhighlight>


==Invisible Stair Mesh==
Which will make it rotate in all kinds of directions.
This is the easier way and i think it looks better.
All of you people that use meshes should know that you can't go through the invisible part so you can't use one mesh as a ramp, there is a way around this. Make a brick, anchor it, make sure it is one high, then put a wedge mesh into it, copy this brick, delete the mesh and put it behind the non-mesh side (this holds the ramp up). Copy the meshed part, put it onto the non-meshed part and you can start to see a ramp forming, keep doing this untill it is as high as you like, then walk up it. If you look closly, you can see that you character floats, this is becuase the way it works is the meshes make "invisible stairs". That is the ramp done. You could delete the parts that hold it up and paste more meshes there but they are upside down so it looks like a ramp.


==Conclusion==
Also, you can use
You should have 2 ramps now, If the top one doesn't work or you can't understand the bottom one, PM me ([http://www.roblox.com/User.aspx?ID=72297 dr01d3k4]) and i will try to fix it. I will add pictures soon so it will be easier.
<syntaxhighlight lang="lua">
--[[User:dr01d3k4|dr01d3k4]]
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.
 
==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]]
 
[[Function Dump/Mathematical Functions]]
 
[[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