Reference API Roblox

Engine API

Website

Related

Reference API Roblox

BodyVelocity

Applies a force to maintain a constant velocity.

This class is deprecated. It exists only for backward compatibility, and should not be used for new work. LinearVelocity should be used instead.
Tags: [Deprecated]

Member index 7

HistoryMember
553MaxForce: Vector3
553P: float
553Velocity: Vector3
553maxForce: Vector3
553velocity: Vector3
462GetLastForce(): Vector3
462lastForce(): Vector3
inherited from Instance
553Archivable: bool
635Capabilities: SecurityCapabilities
553Name: string
553Parent: Instance
635Sandboxed: bool
616UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
486GetDescendants(): Array
486GetFullName(): string
641GetStyled(name: string): Variant
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
580IsPropertyModified(name: string): bool
573Remove(): null
576RemoveTag(tag: string): null
580ResetPropertyToDefault(name: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
648children(): Instances
553clone(): Instance
573destroy(): null
553findFirstChild(name: string, recursive: bool = false): Instance
648getChildren(): Instances
553isDescendantOf(ancestor: Instance): bool
573remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
553childAdded(child: Instance)
inherited from Object
647ClassName: string
647className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
650isA(className: string): bool
647Changed(property: string)

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

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

History 2

MaxForce

TypeDefault
Vector34000, 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).

History 4

P

TypeDefault
float1250

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.

History 4

  • 553 Change Default of P from to 1250
  • 486 Change ThreadSafety of P from ReadOnly to ReadSafe
  • 462 Change ThreadSafety of P from to ReadOnly
  • 47 Add P

Velocity

TypeDefault
Vector30, 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.

History 4

lastForce

Parameters (0)
No parameters.
Returns (1)
Vector3

Returns the last force in the object.

History 2

maxForce

TypeDefault
Vector34000, 4000, 4000
This property is deprecated. It exists only for backward compatibility, and should not be used for new work. MaxForce should be used instead.
This property is not replicated. Its interface does not cross the network boundary.

History 6

Tags: [NotReplicated, Deprecated]

velocity

TypeDefault
Vector30, 2, 0
This property is deprecated. It exists only for backward compatibility, and should not be used for new work. Velocity should be used instead.
This property is not replicated. Its interface does not cross the network boundary.

History 6

Tags: [NotReplicated, Deprecated]

Settings