RocketPropulsion
Applies a force so that a part follows and faces another part.
Memory category | Instances |
---|
Member index 16
Description
The RocketPropulsion object applies a force on a part so that it both follows and faces a target part. It acts like a hybrid of BodyPosition and BodyGyro. Unlike other BodyMovers, a RocketPropulsion must be instructed to begin applying a force: call Fire to start, or call Abort to stop.
You can detect when the part reaches its target using the ReachedTarget event, which fires once the part is within the TargetRadius of the Target.
RocketPropulsion has the most physics-related properties out of all the BodyMovers. It is helpful to separate the properties out into categories based on what they control:
- Goal: Target, TargetOffset and TargetRadius
- Position (Thrust): MaxSpeed, MaxThrust, ThrustD and ThrustP
- Rotation (Turn): - CartoonFactor, MaxTorque, TurnD and TurnP
Remember, you don't need to use both the translational and rotational force
features of a RocketPropulsion: by setting
MaxThrust to 0, you can make a part just
face the target without having it follow the target around (consider also
using a BodyPosition in addition). Similarly, by setting
MaxTorque to (0, 0, 0)
, you can have a
part simply follow another object without facing it (use a BodyGyro if
you want the object to maintain a specific orientation).
History 64
- 573 Change ReturnType of fire from void to null
- 573 Change ReturnType of Fire from void to null
- 573 Change ReturnType of Abort from void to null
- 553 Change PreferredDescriptor of fire from to Fire
- 553 Change Default of TurnP from to 3000
- 553 Change Default of TurnD from to 500
- 553 Change Default of ThrustP from to 5
- 553 Change Default of ThrustD from to 0.00100000005
- 553 Change Default of TargetRadius from to 4
- 553 Change Default of TargetOffset from to Vector3(0, 0, 0)
- 553 Change Default of Target from to
- 553 Change Default of MaxTorque from to Vector3(400000, 400000, 0)
- 553 Change Default of MaxThrust from to 4000
- 553 Change Default of MaxSpeed from to 30
- 553 Change Default of CartoonFactor from to 0.699999988
- 553 Add
- 553 Change PreferredDescriptor of RocketPropulsion from to LineForce
- 516 Change Tags of RocketPropulsion from [] to [Deprecated]
- 486 Change ThreadSafety of TurnP from ReadOnly to ReadSafe
- 486 Change ThreadSafety of TurnD from ReadOnly to ReadSafe
- 486 Change ThreadSafety of ThrustP from ReadOnly to ReadSafe
- 486 Change ThreadSafety of ThrustD from ReadOnly to ReadSafe
- 486 Change ThreadSafety of TargetRadius from ReadOnly to ReadSafe
- 486 Change ThreadSafety of TargetOffset from ReadOnly to ReadSafe
- 486 Change ThreadSafety of Target from ReadOnly to ReadSafe
- 486 Change ThreadSafety of MaxTorque from ReadOnly to ReadSafe
- 486 Change ThreadSafety of MaxThrust from ReadOnly to ReadSafe
- 486 Change ThreadSafety of MaxSpeed from ReadOnly to ReadSafe
- 486 Change ThreadSafety of CartoonFactor from ReadOnly to ReadSafe
- 462 Change ThreadSafety of ReachedTarget from to Unsafe
- 462 Change ThreadSafety of fire from to Unsafe
- 462 Change ThreadSafety of Fire from to Unsafe
- 462 Change ThreadSafety of Abort from to Unsafe
- 462 Change ThreadSafety of TurnP from to ReadOnly
- 462 Change ThreadSafety of TurnD from to ReadOnly
- 462 Change ThreadSafety of ThrustP from to ReadOnly
- 462 Change ThreadSafety of ThrustD from to ReadOnly
- 462 Change ThreadSafety of TargetRadius from to ReadOnly
- 462 Change ThreadSafety of TargetOffset from to ReadOnly
- 462 Change ThreadSafety of Target from to ReadOnly
- 462 Change ThreadSafety of MaxTorque from to ReadOnly
- 462 Change ThreadSafety of MaxThrust from to ReadOnly
- 462 Change ThreadSafety of MaxSpeed from to ReadOnly
- 462 Change ThreadSafety of CartoonFactor from to ReadOnly
- 329 Change ValueType of Target from Object to BasePart
- 79 Change Tags of RocketPropulsion from [preliminary] to []
- 78 Change Tags of RocketPropulsion from [] to [preliminary]
- 79 Change Tags of RocketPropulsion from [preliminary] to []
- 57 Add fire
- 47 Add ReachedTarget
- 47 Add Fire
- 47 Add Abort
- 47 Add TurnP
- 47 Add TurnD
- 47 Add ThrustP
- 47 Add ThrustD
- 47 Add TargetRadius
- 47 Add TargetOffset
- 47 Add Target
- 47 Add MaxTorque
- 47 Add MaxThrust
- 47 Add MaxSpeed
- 47 Add CartoonFactor
- 47 Add RocketPropulsion
Members 16
Abort
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
null |
Causes the Rocket to stop moving towards its target, making it fall.
Thread safety | Unsafe |
---|
CartoonFactor
Type | Default | |
---|---|---|
float | 0.699999988 |
The CartoonFactor property determines the tendency of the part to face the
Target. By default, this property is set
to 0.7
. If set to 0
, the part will make no effort to face the target.
Thread safety | ReadSafe |
---|---|
Category | Goals |
Loaded/Saved | true |
History 4
- 553 Change Default of CartoonFactor from to 0.699999988
- 486 Change ThreadSafety of CartoonFactor from ReadOnly to ReadSafe
- 462 Change ThreadSafety of CartoonFactor from to ReadOnly
- 47 Add CartoonFactor
Fire
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
null |
Causes the rocket to fly towards Target.
Thread safety | Unsafe |
---|
MaxSpeed
Type | Default | |
---|---|---|
float | 30 |
The MaxSpeed property determines the upper limit of the velocity at which the part will move toward the Target. A RocketPropulsion will apply a force to decelerate a part if it exceeds this speed limit.
Thread safety | ReadSafe |
---|---|
Category | Thrust |
Loaded/Saved | true |
MaxThrust
Type | Default | |
---|---|---|
float | 4000 |
The MaxThrust property determines the upper limit of the thrust that may be exerted to move the part. Parts or assemblies that have high mass will require more thrust in order to remain airborne, and thus track the Target.
Thread safety | ReadSafe |
---|---|
Category | Thrust |
Loaded/Saved | true |
MaxTorque
Type | Default | |
---|---|---|
Vector3 | 400000, 400000, 0 |
The MaxTorque property determines the upper limit on the amount of torque that may be exerted in order to rotate the part towards the Target. It functions similarly to BodyGyro.MaxTorque.
Thread safety | ReadSafe |
---|---|
Category | Turn |
Loaded/Saved | true |
ReachedTarget
Parameters (0) | ||
---|---|---|
No parameters. |
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.
Thread safety | Unsafe |
---|
History 2
- 462 Change ThreadSafety of ReachedTarget from to Unsafe
- 47 Add ReachedTarget
Target
Type | Default | |
---|---|---|
BasePart |
The Target property determines the object towards which the
RocketPropulsion will exert force/torque. If set to nil
, the
TargetOffset will be used instead.
Thread safety | ReadSafe |
---|---|
Category | Goals |
Loaded/Saved | true |
TargetOffset
Type | Default | |
---|---|---|
Vector3 | 0, 0, 0 |
The TargetOffset property determines the world offset from the Target. Basically, it makes the RocketPropulsion behave as if the target were really offset by this property. It is especially useful when Target is set to nil, since this property then acts as the target position.
Thread safety | ReadSafe |
---|---|
Category | Goals |
Loaded/Saved | true |
History 4
- 553 Change Default of TargetOffset from to Vector3(0, 0, 0)
- 486 Change ThreadSafety of TargetOffset from ReadOnly to ReadSafe
- 462 Change ThreadSafety of TargetOffset from to ReadOnly
- 47 Add TargetOffset
TargetRadius
Type | Default | |
---|---|---|
float | 4 |
The TargetRadius property determines the maximum distance from the RocketPropulsion.Target the part must be in order for the RocketPropulsion.ReachedTarget event to be fired. It does not affect the exerted forces in any way.
Thread safety | ReadSafe |
---|---|
Category | Goals |
Loaded/Saved | true |
History 4
- 553 Change Default of TargetRadius from to 4
- 486 Change ThreadSafety of TargetRadius from ReadOnly to ReadSafe
- 462 Change ThreadSafety of TargetRadius from to ReadOnly
- 47 Add TargetRadius
ThrustD
Type | Default | |
---|---|---|
float | 0.00100000005 |
The D property is used to dampen the velocity of the part in order to prevent it from overshooting the Target and causing a rubber-banding effect. It behaves similarly to BodyPosition.D.
Thread safety | ReadSafe |
---|---|
Category | Thrust |
Loaded/Saved | true |
ThrustP
Type | Default | |
---|---|---|
float | 5 |
The P property determines how much power is used while applying force in order to reach the Target position. The higher this value, the more power will be used and the faster it will be used. This property works similarly to BodyPosition.P.
Thread safety | ReadSafe |
---|---|
Category | Thrust |
Loaded/Saved | true |
TurnD
Type | Default | |
---|---|---|
float | 500 |
The D property is how much dampening will be applied to the torque used to face the Target. When the part approaches the goal orientation it needs to decelerate, otherwise it will rotate past the goal and have to stop and re-accelerate back toward the goal. This is often creates undesirable rubber-banding effect, so applying dampening using this property is how that effect is avoided. The higher this value is set, the greater the dampening curve becomes, or the slower the part will approach the goal orientation.
Thread safety | ReadSafe |
---|---|
Category | Turn |
Loaded/Saved | true |
TurnP
Type | Default | |
---|---|---|
float | 3000 |
The P property determines how much power is used while applying torque in order to face the Target. The higher this value, the more power will be used and the faster it will be used.
Thread safety | ReadSafe |
---|---|
Category | Turn |
Loaded/Saved | true |
fire
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
null |
Thread safety | Unsafe |
---|