Reference API Roblox

Engine API

Website

Related

Reference API Roblox

LinearVelocity

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

Member index 13

HistoryMember
582ForceLimitMode: ForceLimitMode
592ForceLimitsEnabled: bool
553LineDirection: Vector3
553LineVelocity: float
582MaxAxesForce: Vector3
553MaxForce: float
582MaxPlanarAxesForce: Vector2
553PlaneVelocity: Vector2
553PrimaryTangentAxis: Vector3
553RelativeTo: ActuatorRelativeTo
553SecondaryTangentAxis: Vector3
553VectorVelocity: Vector3
553VelocityConstraintMode: VelocityConstraintMode
inherited from Constraint
553Active: bool
553Attachment0: Attachment
553Attachment1: Attachment
553Color: BrickColor
553Enabled: bool
553Visible: bool
604GetDebugAppliedForce(bodyId: int): Vector3
604GetDebugAppliedTorque(bodyId: int): 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 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 23

Members 13

ForceLimitMode

TypeDefault
ForceLimitModeMagnitude

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 1

ForceLimitsEnabled

TypeDefault
booltrue

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 1

LineDirection

TypeDefault
Vector31, 0, 0

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

History 2

LineVelocity

TypeDefault
float-0

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

History 2

MaxAxesForce

TypeDefault
Vector31000, 1000, 1000

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 1

MaxForce

TypeDefault
float1000

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

History 2

MaxPlanarAxesForce

TypeDefault
Vector21000, 1000

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 1

PlaneVelocity

TypeDefault
Vector20, 0

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

History 2

PrimaryTangentAxis

TypeDefault
Vector31, 0, 0

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

History 2

RelativeTo

TypeDefault
ActuatorRelativeToWorld

Sets the ActuatorRelativeTo property for the LinearVelocity constraint.

History 2

SecondaryTangentAxis

TypeDefault
Vector30, 1, 0

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

History 2

VectorVelocity

TypeDefault
Vector30, 0, 0

Vector3 velocity value when VelocityConstraintMode is set to Vector.

History 2

VelocityConstraintMode

TypeDefault
VelocityConstraintModeVector

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

History 2

Settings