BodyVelocity

Show Deprecated
deprecated

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.

Summary

Properties

  • read parallel

    Determines the limit on how much force that may be applied to each axis.

  • read parallel

    Determines how aggressive of a force is applied in reaching the goal velocity.

  • read parallel

    Determines the goal velocity.

Methods

Properties

MaxForce

read parallel

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

read parallel

his 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.

Velocity

read parallel

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.

Methods

GetLastForce

GetLastForce is not implemented. It will always return the 0 vector. Developers are advised to use AlignPosition instead


Returns

lastForce

Returns the last force in the object.


Returns

Events