Reference API Roblox

Engine API

Website

Related

Reference API Roblox

LinearVelocity

Applies force on an assembly to maintain a constant linear velocity.

Member index 14

HistoryMember
726ForceLimitMode: ForceLimitMode
726ForceLimitsEnabled: bool
726LineDirection: Vector3
726LineVelocity: float
726MaxAxesForce: Vector3
726MaxForce: float
726MaxPlanarAxesForce: Vector2
726PlaneVelocity: Vector2
726PrimaryTangentAxis: Vector3
726ReactionForceEnabled: bool
726RelativeTo: ActuatorRelativeTo
726SecondaryTangentAxis: Vector3
726VectorVelocity: Vector3
726VelocityConstraintMode: VelocityConstraintMode
inherited from Constraint
726Active: bool
726Attachment0: Attachment
726Attachment1: Attachment
726Color: BrickColor
726Enabled: bool
726Visible: bool
604GetDebugAppliedForce(bodyId: int): Vector3
604GetDebugAppliedTorque(bodyId: int): Vector3
inherited from Instance
726Archivable: bool
726Capabilities: SecurityCapabilities
726IsInSandbox: bool
726Name: string
726Parent: Instance
726PredictionMode: PredictionMode
726Sandboxed: bool
726UniqueId: 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
707GetDescendants(): Instances
486GetFullName(): string
706GetStyled(name: string, selector: string?): Variant
657GetStyledPropertyChangedSignal(property: string): RBXScriptSignal
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
664IsPropertyModified(property: string): bool
698QueryDescendants(selector: string): Instances
573Remove(): null
576RemoveTag(tag: string): null
664ResetPropertyToDefault(property: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
726children(): Instances
726clone(): Instance
726destroy(): null
726findFirstChild(name: string, recursive: bool = false): Instance
726getChildren(): Instances
726isDescendantOf(ancestor: Instance): bool
726remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
657StyledPropertiesChanged()
726childAdded(child: Instance)
inherited from Object
726ClassName: string
726className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
726isA(className: string): bool
647Changed(property: string)

Description

The LinearVelocity constraint applies force on an assembly to maintain a constant linear velocity. It can be set to apply force along a Vector3, line, or 2D plane. Alternatively:

  • If you want to control the amount of force applied, use a VectorForce constraint.
  • If you only need initial linear velocity, set the AssemblyLinearVelocity property directly on the assembly.

When configuring this constraint, it may be helpful to study Roblox Units to understand how Roblox units compare to metric units.

Relativity

Application of velocity can be controlled through the constraint's RelativeTo property. If set to World, force will be applied in world coordinates, independent of the parent or attachment orientations. If set to Attachment0 or Attachment1, force will be applied relative to Attachment0 or Attachment1 respectively.

History 39

Members 14

ForceLimitMode

TypeDefault
ForceLimitMode

Determines how the constraint force will be limited. When set to Magnitude, the constraint force will have a magnitude less than MaxForce. When set to PerAxis, the force along each axis will be less than the corresponding value in MaxAxesForce when VelocityConstraintMode is Vector or the corresponding value in MaxPlanarAxesForce when VelocityConstraintMode is Plane. Only used when ForceLimitsEnabled is true.

History 2

ForceLimitsEnabled

TypeDefault
bool

Determines if the constraint force will be limited or if the physics solver can apply an unlimited force to achieve the target velocity. When enabled, the constraint force is limited based on ForceLimitMode. When disabled, the physics solver will always apply a force that is large enough to achieve the target velocity.

History 2

LineDirection

TypeDefault
Vector3

The normalized Vector3 direction for constraining the velocity along a line, when VelocityConstraintMode is set to Line.

History 3

LineVelocity

TypeDefault
float

Float value of the velocity when VelocityConstraintMode is set to Line.

History 3

MaxAxesForce

TypeDefault
Vector3

Maximum force along each axis that the constraint can apply to achieve the target velocity. Only used if ForceLimitsEnabled is true, ForceLimitMode is PerAxis, and VelocityConstraintMode is Vector. The axes used to apply the limit correspond to the RelativeTo property.

History 2

MaxForce

TypeDefault
float

Maximum magnitude of the force vector the constraint can apply. Only used if ForceLimitsEnabled is true and ForceLimitMode is Magnitude.

History 3

MaxPlanarAxesForce

TypeDefault
Vector2

Maximum force along each axis that the constraint can apply to achieve the plane velocity. Only used if ForceLimitsEnabled is true, ForceLimitMode is PerAxis, and VelocityConstraintMode is Plane. The axes used to apply the limit correspond to the RelativeTo property.

History 2

PlaneVelocity

TypeDefault
Vector2

Vector2 value of the velocity in each tangent direction of the plane, when VelocityConstraintMode is set to Plane.

History 3

PrimaryTangentAxis

TypeDefault
Vector3

The primary axis in the plane, when VelocityConstraintMode is set to Plane. Value depends on the value of RelativeTo as follows:

History 3

ReactionForceEnabled

TypeDefault
bool

History 2

RelativeTo

TypeDefault
ActuatorRelativeTo

Sets the ActuatorRelativeTo property for the constraint.

History 3

SecondaryTangentAxis

TypeDefault
Vector3

The secondary axis in the plane, when VelocityConstraintMode is set to Plane. Value depends on the value of RelativeTo as follows:

History 3

VectorVelocity

TypeDefault
Vector3

Vector3 velocity value when VelocityConstraintMode is set to Vector.

History 3

VelocityConstraintMode

TypeDefault
VelocityConstraintMode

The mode of the constraint: Line, Plane, or Vector. Default is Vector.

History 3

Settings