How to make a Trampoline: Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Davidii
>NXTBoy
No edit summary
 
(14 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{CatUp|Tutorials}}
__TOC__


==Introduction==
This tutorial is intended to show how to build a trampoline.
This is a tutorial for '''BEGINNER TO INTERMEDIATE BUILDERS''', so anyone should be able to do this tutorial just fine. This tutorial is also easiest in '''ROBLOX STUDIO''', but if you prefer solo, that's fine.


==Setup==
==Setup==
Let's begin by adding two bricks. Make one 5x1x5, and one 4x1x4. Stack the larger one on top. Now, you'll want to look in your properties, and if you don't have the properties window, then select View->Properties.
Let's begin by adding one brick. Now, you'll want to look in your properties, and if you don't have the properties window, then select View->Properties.


==Making it a Trampoline==
==Script==
Alright, now begin by selecting the larger brick.(It should be on top of the smaller brick.)Go to properties, and find the Velocity property. Click the plus and you should see three letters, x, y, and z. Select the value of y, and set it to 100. Now, group the larger brick and the smaller brick. (Select both bricks and press Ctrl+G.)That made your trampoline! Now to test it. If you are in Roblox Studio, select Tools->Test->Play Solo. You should get another window where you are playing solo. Simply jump onto the trampoline, and you'll bounce on it! If you want to change how high you go, then go back and change the Y velocity value. You can also copy, and move this trampoline without the velocity ressetting. Well, that's the tutorial, thanks for reading!
* Select the brick.  
* Insert > Object > [[Script]].
* Copy and Paste the following into the script object:
 
<pre>local v = 200
 
local trampoline = script.Parent
 
trampoline.Touched:connect(function(part)
local character = part.Parent
if character:findFirstChild("Humanoid") and character:findFirstChild("Torso") then
character.Torso.Velocity = trampoline.CFrame * Vector3.new(0,v,0)
wait(0.5)
end
end)
</pre>
 
This script was taken right from the trampoline model. If you want to change how fast you go, chang the variable '''V'''.
The problem with this is that if you make your entire trampoline with this script, the trampoline will bounce equally high in the middle as on the outer edge.  This isn't representative of real life.  So, what you can do is make the trampoline bricks in the middle bounce a little higher (the 'sweet spot') than on the outer edges to make it a little more realistic.
 
==Alternative method==
 
* Insert > Object > [[Part]]
* Move the newly created brick where you want it to be.
* Anchor this brick.  (This is important).
* Select this brick.
* In the [[Properties]] window, click the "+" next to Velocity.
* Change the "y" Value between 0-300.  NOTE:If it goes over 500 your body might disappear.
* Test your map.  When you walk on top of the brick, you will shoot into the air.
 
[[Category:Scripting Tutorials]]

Latest revision as of 08:30, 25 May 2011

This tutorial is intended to show how to build a trampoline.

Setup

Let's begin by adding one brick. Now, you'll want to look in your properties, and if you don't have the properties window, then select View->Properties.

Script

  • Select the brick.
  • Insert > Object > Script.
  • Copy and Paste the following into the script object:
local v = 200

local trampoline = script.Parent

trampoline.Touched:connect(function(part)
	local character = part.Parent
	if character:findFirstChild("Humanoid") and character:findFirstChild("Torso") then
		character.Torso.Velocity = trampoline.CFrame * Vector3.new(0,v,0)
		wait(0.5)
	end
end)

This script was taken right from the trampoline model. If you want to change how fast you go, chang the variable V. The problem with this is that if you make your entire trampoline with this script, the trampoline will bounce equally high in the middle as on the outer edge. This isn't representative of real life. So, what you can do is make the trampoline bricks in the middle bounce a little higher (the 'sweet spot') than on the outer edges to make it a little more realistic.

Alternative method

  • Insert > Object > Part
  • Move the newly created brick where you want it to be.
  • Anchor this brick. (This is important).
  • Select this brick.
  • In the Properties window, click the "+" next to Velocity.
  • Change the "y" Value between 0-300. NOTE:If it goes over 500 your body might disappear.
  • Test your map. When you walk on top of the brick, you will shoot into the air.