Class
LinearVelocity
Applies force on an assembly to maintain a constant linear velocity.
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#
ForceLimitModeForceLimitMode | Determines how the constraint force will be limited.ReadSafe |
ForceLimitsEnabledboolean | Determines if the constraint force will be limited or if the physics solver can apply an unlimited force to achieve the target velocity.ReadSafe |
LineDirectionVector3 | The normalized Vector3 direction for constraining the velocity
along a line.ReadSafe |
LineVelocityfloat | Float value of the velocity when
VelocityConstraintMode is
set to Line.ReadSafe |
MaxAxesForceVector3 | Maximum force along each axis that the constraint can apply to achieve the
vector velocity. Only used if
ForceLimitsEnabled is true,
ForceLimitMode is
PerAxis, and
VelocityConstraintMode is
Vector.ReadSafe |
MaxForcefloat | Maximum magnitude of the force vector the constraint can apply.ReadSafe |
MaxPlanarAxesForceVector2 | 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.ReadSafe |
PlaneVelocityVector2 | Vector2 value of the velocity in each tangent direction of the
plane.ReadSafe |
PrimaryTangentAxisVector3 | The primary axis in the plane, when
VelocityConstraintMode is
set to Plane.ReadSafe |
ReactionForceEnabledboolean | Determines whether an equal and opposite reaction force is also applied to
the assembly of Attachment1 when
RelativeTo is
Attachment1.ReadSafe |
RelativeToActuatorRelativeTo | Sets the ActuatorRelativeTo property for the constraint.ReadSafe |
SecondaryTangentAxisVector3 | The secondary axis in the plane, when
VelocityConstraintMode is
set to Plane.ReadSafe |
VectorVelocityVector3 | Vector3 velocity value when
VelocityConstraintMode is
set to Vector.ReadSafe |
VelocityConstraintModeVelocityConstraintMode | The mode of the constraint.ReadSafe |
ForceLimitMode: ForceLimitMode#
ReadSafe
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.
ForceLimitsEnabled: boolean#
ReadSafe
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: Vector3#
ReadSafe
The normalized Vector3 direction for constraining the velocity
along a line, when
VelocityConstraintMode is
set to Line.
LineVelocity: float#
ReadSafe
Float value of the velocity when
VelocityConstraintMode is
set to Line.
MaxAxesForce: Vector3#
ReadSafe
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.
MaxForce: float#
ReadSafe
Maximum magnitude of the force vector the constraint can apply. Only used
if ForceLimitsEnabled is true
and ForceLimitMode is
Magnitude.
MaxPlanarAxesForce: Vector2#
ReadSafe
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.
PlaneVelocity: Vector2#
ReadSafe
Vector2 value of the velocity in each tangent direction of the
plane, when
VelocityConstraintMode is
set to Plane.
PrimaryTangentAxis: Vector3#
ReadSafe
The primary axis in the plane, when
VelocityConstraintMode is
set to Plane. Value depends on the value of
RelativeTo as 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.
ReactionForceEnabled: boolean#
ReadSafe
Determines whether the constraint applies an equal and opposite reaction
force to the assembly of Attachment1.
Defaults to true. This reaction force is relevant when
RelativeTo is
ActuatorRelativeTo.Attachment1 — the mode in which the constraint
drives the Attachment0 assembly's velocity relative to the Attachment1
assembly. Because RelativeTo defaults to
ActuatorRelativeTo.World, this property is typically only
meaningful once RelativeTo is set to Attachment1.
When enabled in that mode, the constraint applies the reaction force to
the Attachment1 assembly, coupling the two assemblies. When disabled,
the constraint applies force only to the Attachment0 assembly; the
Attachment1 assembly receives no reaction force, though its pose and
velocity are still read as the reference frame for the target velocity.
RelativeTo: ActuatorRelativeTo#
ReadSafe
Sets the ActuatorRelativeTo property for the constraint.
SecondaryTangentAxis: Vector3#
ReadSafe
The secondary axis in the plane, when
VelocityConstraintMode is
set to Plane. Value depends on the value of
RelativeTo as 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.
VectorVelocity: Vector3#
ReadSafe
Vector3 velocity value when
VelocityConstraintMode is
set to Vector.
VelocityConstraintMode: VelocityConstraintMode#
ReadSafe
Inherited members#
Inherited from Instance 58
Properties (10)
Archivable, archivable, Capabilities, IsInSandbox, Name, Parent, PredictionMode, RobloxLocked, Sandboxed, UniqueId
Methods (39)
AddTag, children, ClearAllChildren, Clone, clone, Destroy, destroy, FindFirstAncestor, FindFirstAncestorOfClass, FindFirstAncestorWhichIsA, FindFirstChild, findFirstChild, FindFirstChildOfClass, FindFirstChildWhichIsA, FindFirstDescendant, GetActor, GetAttribute, GetAttributeChangedSignal, GetAttributes, GetChildren, getChildren, GetDebugId, GetDescendants, GetFullName, GetStyled, GetStyledPropertyChangedSignal, GetTags, HasTag, IsAncestorOf, IsDescendantOf, isDescendantOf, IsPropertyModified, QueryDescendants, Remove, remove, RemoveTag, ResetPropertyToDefault, SetAttribute, WaitForChild