Class · inherits Constraint
LinearVelocity
Applies force on an assembly to maintain a constant linear velocity.
About LinearVelocity
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
VectorForceconstraint. - If you only need initial linear velocity, set the
AssemblyLinearVelocityproperty 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.
Properties 14
ForceLimitMode
: ForceLimitModeDetermines how the constraint force will be limited.Determines how the constraint force will be limited. When set to
Magnitude, the constraint force will have a magnitude less thanMaxForce. When set toPerAxis, the force along each axis will be less than the corresponding value inMaxAxesForcewhenVelocityConstraintModeisVectoror the corresponding value inMaxPlanarAxesForcewhenVelocityConstraintModeisPlane. Only used whenForceLimitsEnabledistrue.ForceLimitsEnabled
: booleanDetermines if the constraint force will be limited or if the physics solver can apply an unlimited force to achieve the target velocity.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.LineDirection
: Vector3The normalizedVector3direction for constraining the velocity along a line.The normalized
Vector3direction for constraining the velocity along a line, whenVelocityConstraintModeis set toLine.LineVelocity
: floatFloat value of the velocity whenVelocityConstraintModeis set toLine.MaxAxesForce
: Vector3Maximum force along each axis that the constraint can apply to achieve the vector velocity. Only used ifForceLimitsEnabledistrue,ForceLimitModeisPerAxis, andVelocityConstraintModeisVector.Maximum force along each axis that the constraint can apply to achieve the target velocity. Only used if
ForceLimitsEnabledistrue,ForceLimitModeisPerAxis, andVelocityConstraintModeisVector. The axes used to apply the limit correspond to theRelativeToproperty.MaxForce
: floatMaximum magnitude of the force vector the constraint can apply.Maximum magnitude of the force vector the constraint can apply. Only used if
ForceLimitsEnabledistrueandForceLimitModeisMagnitude.MaxPlanarAxesForce
: Vector2Maximum force along each axis that the constraint can apply to achieve the plane velocity. Only used ifForceLimitsEnabledistrue,ForceLimitModeisPerAxis, andVelocityConstraintModeisPlane.Maximum force along each axis that the constraint can apply to achieve the plane velocity. Only used if
ForceLimitsEnabledistrue,ForceLimitModeisPerAxis, andVelocityConstraintModeisPlane. The axes used to apply the limit correspond to theRelativeToproperty.PlaneVelocity
: Vector2Vector2value of the velocity in each tangent direction of the plane.Vector2value of the velocity in each tangent direction of the plane, whenVelocityConstraintModeis set toPlane.PrimaryTangentAxis
: Vector3The primary axis in the plane, whenVelocityConstraintModeis set toPlane.The primary axis in the plane, when
VelocityConstraintModeis set toPlane. Value depends on the value ofRelativeToas follows:- If
RelativeTois set toAttachment0, this axis is theAxisofAttachment0. - If
RelativeTois set toAttachment1, this axis is theAxisofAttachment1. - If
RelativeTois set toWorld, this value must be specified in the world space.
- If
ReactionForceEnabled
: booleanDetermines whether an equal and opposite reaction force is also applied to the assembly ofAttachment1whenRelativeToisAttachment1.Determines whether the constraint applies an equal and opposite reaction force to the assembly of
Attachment1. Defaults totrue. This reaction force is relevant whenRelativeToisActuatorRelativeTo.Attachment1— the mode in which the constraint drives theAttachment0assembly's velocity relative to theAttachment1assembly. BecauseRelativeTodefaults toActuatorRelativeTo.World, this property is typically only meaningful onceRelativeTois set toAttachment1.When enabled in that mode, the constraint applies the reaction force to the
Attachment1assembly, coupling the two assemblies. When disabled, the constraint applies force only to theAttachment0assembly; theAttachment1assembly receives no reaction force, though its pose and velocity are still read as the reference frame for the target velocity.RelativeTo
: ActuatorRelativeToSets theActuatorRelativeToproperty for the constraint.SecondaryTangentAxis
: Vector3The secondary axis in the plane, whenVelocityConstraintModeis set toPlane.The secondary axis in the plane, when
VelocityConstraintModeis set toPlane. Value depends on the value ofRelativeToas follows:- If
RelativeTois set toAttachment0, this axis is theSecondaryAxisofAttachment0. - If
RelativeTois set toAttachment1, this axis is theSecondaryAxisofAttachment1. - If
RelativeTois set toWorld, this value must be specified in the world space.
- If
VectorVelocity
: Vector3Vector3velocity value whenVelocityConstraintModeis set toVector.
LinearVelocity also has every member of Constraint. Deprecated and Roblox-only members are hidden.
Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.