RBX.lua.RocketPropulsion (Object): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Anaminus
mNo edit summary
>Anaminus
cleaned up
Line 9: Line 9:
In addition to the Global functions, RocketPropulsion incorporates the following:
In addition to the Global functions, RocketPropulsion incorporates the following:


*[[Abort (Function)|Abort()]] - Causes the rocket to fall down
*[[Abort (Function)|Abort]]
*[[Fire (Function)|Fire()]] - causes the rocket to fly towards Target
*[[Fire (Function)|Fire]]


==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.  CartoonFactor must lie between 0 and 1.
*[[CartoonFactor (Property)|CartoonFactor]]
*[[MaxSpeed (Property)|MaxSpeed]] - The maximum speed that the rocket will travel at
*[[MaxSpeed (Property)|MaxSpeed]]
*[[MaxThrust (Property)|MaxThrust]] - The maximum thrust the rocket will exert. Heavy rockets need more thrust to remain airborne and to track the target.
*[[MaxThrust (Property)|MaxThrust]]
*[[MaxTorque (Property)|MaxTorque]] - The maximum torque the rocket will use to rotate itself.
*[[MaxTorque (Property)|MaxTorque]]
*[[Target (Property)|Target]] - What [[Part]] the object will fly towards.
*[[Target (Property)|Target]]
 
*[[TargetOffset (Property)|TargetOffset]]
*[[TargetOffset (Property)|TargetOffset]]
*[[TargetRadius (Property)|TargetRadius]] - The radius of the Target before the [[ReachedTarget (Event)|ReachedTarget event]] is fired.
*[[TargetRadius (Property)|TargetRadius]]
*[[ThrustD (Property)|ThrustD]] - The D in the PD controller that governs the motion of the Rocket. Dampens the motion of the Rocket, preventing it from overshooting.
*[[ThrustD (Property)|ThrustD]]
*[[ThrustP (Property)|ThrustP]] - The P in the PD controller that governs the motion of the Rocket. The higher the number, the more aggressively the rocket will move towards the Target.
*[[ThrustP (Property)|ThrustP]]
*[[TurnD (Property)|TurnD]] - The D in the PD controller that governs the rotation of the Rocket. Dampens the rotation of the Rocket, preventing it from overshooting.
*[[TurnD (Property)|TurnD]]
*[[TurnP (Property)|TurnP]] - The P in the PD controller that governs the rotation of the Rocket. The higher the number, the more aggressively the rocket will turn towards the Target. [http://blog.roblox.com/?p=142]
*[[TurnP (Property)|TurnP]]


== Events ==
== Events ==
*[[ReachedTarget (Event)|ReachedTarget]] - This event is fired when the Rocket comes within TargetRadius of the target.  (This is used to make the rocket work, such as make an explosion when it flies near the Target.)
*[[ReachedTarget (Event)|ReachedTarget]]




Line 42: Line 41:
rp:Fire()
rp:Fire()
</pre>
</pre>
== See Also ==
[http://blog.roblox.com/?p=142 Blog post]


[[Category:ROBLOX Lua Objects]]
[[Category:ROBLOX Lua Objects]]

Revision as of 01:40, 3 January 2009


Preliminary:This item is under development and is likely to change. Use only for experimental work.

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:

Events


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()

See Also

Blog post