BodyVelocity
Applies a force to maintain a constant velocity.
Memory category | Instances |
---|
Member index 7
Description
The BodyVelocity object applies a force on a BasePart such that it will maintain a constant velocity. The BodyVelocity.Velocity property, not to be confused with BasePart.AssemblyLinearVelocity, controls the goal velocity.
BodyVelocity is the linear counterpart to BodyAngularVelocity. If you need the part to move toward a goal position, use BodyPosition instead. If you need further control on a force applied to an object, consider using a BodyForce or BodyThrust instead.
The strength of the force applied by this object is controlled by several factors, namely the difference between the part's current velocity and the goal velocity. This is multiplied by P (power) to either amplify or diminish it. The resulting force is then capped by MaxForce.
History 31
- 553 Change PreferredDescriptor of velocity from to Velocity
- 553 Change Default of velocity from to Vector3(0, 2, 0)
- 553 Change PreferredDescriptor of maxForce from to MaxForce
- 553 Change Default of maxForce from to Vector3(4000, 4000, 4000)
- 553 Change Default of Velocity from to Vector3(0, 2, 0)
- 553 Change Default of P from to 1250
- 553 Change Default of MaxForce from to Vector3(4000, 4000, 4000)
- 553 Change PreferredDescriptor of BodyVelocity from to LinearVelocity
- 516 Change Tags of BodyVelocity from [] to [Deprecated]
- 486 Change ThreadSafety of velocity from ReadOnly to ReadSafe
- 486 Change ThreadSafety of maxForce from ReadOnly to ReadSafe
- 486 Change ThreadSafety of Velocity from ReadOnly to ReadSafe
- 486 Change ThreadSafety of P from ReadOnly to ReadSafe
- 486 Change ThreadSafety of MaxForce from ReadOnly to ReadSafe
- 462 Change ThreadSafety of lastForce from to Unsafe
- 462 Change ThreadSafety of GetLastForce from to Unsafe
- 462 Change ThreadSafety of velocity from to ReadOnly
- 462 Change ThreadSafety of maxForce from to ReadOnly
- 462 Change ThreadSafety of Velocity from to ReadOnly
- 462 Change ThreadSafety of P from to ReadOnly
- 462 Change ThreadSafety of MaxForce from to ReadOnly
- 210 Change Tags of velocity from [NotReplicated] to [NotReplicated, Deprecated]
- 210 Change Tags of maxForce from [NotReplicated] to [NotReplicated, Deprecated]
- 210 Add Velocity
- 210 Add MaxForce
- 47 Add lastForce
- 47 Add GetLastForce
- 47 Add velocity
- 47 Add maxForce
- 47 Add P
- 47 Add BodyVelocity
Members 7
GetLastForce
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Vector3 |
GetLastForce is not implemented. It will always return the 0 vector. Developers are advised to use AlignPosition instead
Thread safety | Unsafe |
---|
History 2
- 462 Change ThreadSafety of GetLastForce from to Unsafe
- 47 Add GetLastForce
MaxForce
Type | Default | |
---|---|---|
Vector3 | 4000, 4000, 4000 |
The MaxForce property determines the limit on the amount of force that may be applied on each axis in reaching the goal Velocity. If a part isn't moving, consider increasing this value (also check that it is not Anchored or attached to any anchored parts).
Thread safety | ReadSafe |
---|---|
Category | Goals |
Loaded/Saved | true |
P
Type | Default | |
---|---|---|
float | 1250 |
This property is ignored if PGS is enabled via Workspace.PGSPhysicsSolverEnabled, which is enabled by default.
The P property determines how much power is used while applying force in order to reach the goal Velocity. The higher this value, the more power will be used and the faster it will be used. The force the BodyVelocity exerts increases as the difference between the part's current velocity and the goal velocity increases. This property is multiplied to this force to either amplify or diminish it.
Thread safety | ReadSafe |
---|---|
Category | Goals |
Loaded/Saved | true |
Velocity
Type | Default | |
---|---|---|
Vector3 | 0, 2, 0 |
The Velocity property (not to be confused with BasePart.Velocity) determines the target velocity towards which force will be exerted. It is specified relative to the world, not the part.
Thread safety | ReadSafe |
---|---|
Category | Goals |
Loaded/Saved | true |
lastForce
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Vector3 |
Returns the last force in the object.
Thread safety | Unsafe |
---|
maxForce
Type | Default | |
---|---|---|
Vector3 | 4000, 4000, 4000 |
Thread safety | ReadSafe |
---|---|
Category | Goals |
Loaded/Saved | true/false |
History 6
- 553 Change PreferredDescriptor of maxForce from to MaxForce
- 553 Change Default of maxForce from to Vector3(4000, 4000, 4000)
- 486 Change ThreadSafety of maxForce from ReadOnly to ReadSafe
- 462 Change ThreadSafety of maxForce from to ReadOnly
- 210 Change Tags of maxForce from [NotReplicated] to [NotReplicated, Deprecated]
- 47 Add maxForce
velocity
Type | Default | |
---|---|---|
Vector3 | 0, 2, 0 |
Thread safety | ReadSafe |
---|---|
Category | Goals |
Loaded/Saved | true/false |
History 6
- 553 Change PreferredDescriptor of velocity from to Velocity
- 553 Change Default of velocity from to Vector3(0, 2, 0)
- 486 Change ThreadSafety of velocity from ReadOnly to ReadSafe
- 462 Change ThreadSafety of velocity from to ReadOnly
- 210 Change Tags of velocity from [NotReplicated] to [NotReplicated, Deprecated]
- 47 Add velocity