RBX.lua.RocketPropulsion (Object): Difference between revisions
From Legacy Roblox Wiki
Jump to navigationJump to search
>Mindraker |
>Mindraker No edit summary |
||
Line 6: | Line 6: | ||
In addition to the Global functions, RocketPropulsion incorporates the following: | In addition to the Global functions, RocketPropulsion incorporates the following: | ||
* | *[[Abort (Function)|Abort()]] - Makes the rocket fall. | ||
* | *[[Fire (Function)|Fire()]] - Makes the rocket fly. | ||
==Properties== | ==Properties== | ||
In addition to the Global properties, the BodyForce also has these: | In addition to the Global properties, the BodyForce also has these: | ||
* [[ | *[[CartoonFactor (Property)|CartoonFactor]] - In a nutshell, the tilt of the rocket as it flies. A value of 0 will make the rocket's nose point upwards. A value of 1 will make the rocket's nose point straight towards the Target. | ||
*[[MaxSpeed (Property)|MaxSpeed]] - How fast the rocket will fly. | |||
*[[MaxThrust (Property)|MaxThrust]] - The amount of thrust that is exerted on the rocket, used to keep heavier rockets airborne. | |||
* | *[[MaxTorque (Property)|MaxTorque]] - The maximum amount of force that is used to turn the rocket. | ||
*MaxThrust - The amount of thrust that is exerted on the rocket, used to keep heavier rockets airborne. | *[[Target (Property)|Target]] - What [[Part]] the object will fly towards. | ||
* [[ | *[[TargetOffset (Property)|TargetOffset]] | ||
*[[TargetRadius (Property)|TargetRadius]] - The radius of the Target before the [[ReachedTarget (Event)|ReachedTarget event]] is fired. | |||
*[[ThrustD (Property)|ThrustD]] | |||
*[[ThrustP (Property)|ThrustP]] | |||
*[[TurnD (Property)|TurnD]] | |||
*[[TurnP (Property)|TurnP]] | |||
== Events == | == Events == | ||
*ReachedTarget - The event that is fire when the rocket flies within the desired TargetRadius. (This is used to make the rocket work, such as make an explosion when it flies near the Target.) | *[[ReachedTarget (Event)|ReachedTarget]] - The event that is fire when the rocket flies within the desired TargetRadius. (This is used to make the rocket work, such as make an explosion when it flies near the Target.) | ||
Revision as of 14:06, 18 September 2008
The RocketPropulsion object is used to apply force to a Part or other object in a similiar manner as a rocket (ie. towards a given part, with given thrust and torque).
Functions
In addition to the Global functions, RocketPropulsion incorporates the following:
Properties
In addition to the Global properties, the BodyForce also has these:
- CartoonFactor - In a nutshell, the tilt of the rocket as it flies. A value of 0 will make the rocket's nose point upwards. A value of 1 will make the rocket's nose point straight towards the Target.
- MaxSpeed - How fast the rocket will fly.
- MaxThrust - The amount of thrust that is exerted on the rocket, used to keep heavier rockets airborne.
- MaxTorque - The maximum amount of force that is used to turn the rocket.
- Target - What Part the object will fly towards.
- TargetOffset
- TargetRadius - The radius of the Target before the ReachedTarget event is fired.
- ThrustD
- ThrustP
- TurnD
- TurnP
Events
- ReachedTarget - The event that is fire when the rocket flies within the desired TargetRadius. (This is used to make the rocket work, such as make an explosion when it flies near the Target.)
Example Script
Insert this script into a small, unanchored part, and change the name in the script:
local rocket = script.Parent local rp = Instance.new("RocketPropulsion") rp.Parent = rocket rp.Target = game.Players.YourNameHere.Character.Torso rp:Fire()