Class
BodyPosition
Deprecated
Applies a force to maintain a constant position.
Deprecated. This object is deprecated and should not be used for new work. Use
AlignPosition instead, and see the
legacy conversion notes.
The BodyPosition object applies a force on an assembly such that it will
maintain a constant position in the world. The
Position property, not to be confused with
BasePart.Position, controls the target world position. This is the
translational counterpart to a BodyGyro.
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 distance to the goal position: the force is stronger when
farther away from the goal. This is amplified by P
(power). The present velocity will also dampen the force applied by this
object, and this is amplified by D (dampening). The
resulting force is then capped by MaxForce. Note
the force applied on the assembly to achieve the goal position may vary on a
per-axis basis.
Properties 6#
Dfloat | Determines the amount of dampening to use in reaching the goal
Position.ReadSafe |
MaxForceVector3 | Determines the limit on how much force that may be applied to each axis.ReadSafe |
maxForceVector3 | ReadSafeDeprecatedNotReplicated |
Pfloat | Determines how aggressive of a force is applied in reaching the goal position.ReadSafe |
PositionVector3 | Determines the goal position towards which force will be applied.ReadSafe |
positionVector3 | ReadSafeDeprecatedNotReplicated |
D: float#
ReadSafe
This property determines how much dampening will be applied to the force
used toward reaching the goal Position. When
the assembly approaches the goal position it needs to decelerate,
otherwise it will move past the goal and have to stop and re-accelerate
back toward the goal. This is often creates an undesirable
"rubber‑banding" effect, avoided by applying dampening. The higher this
value is set, the greater the dampening curve becomes, or the slower the
assembly will approach the goal position.
MaxForce: Vector3#
ReadSafe
maxForce: Vector3#
NotReplicatedDeprecatedReadSafeDeprecated
Deprecated. This property is a deprecated variant of BodyPosition.MaxForce
which should be used instead.
P: float#
ReadSafe
This property determines how much power is used while applying force in
order to reach the goal Position. The higher
this value, the more power will be used and the faster it will be used.
The force the BodyPosition exerts increases as the difference
between the assembly's current position and the goal position increases.
This property is multiplied to this force to either amplify or diminish
it.
Position: Vector3#
ReadSafe
This property determines the goal position towards which the
BodyPosition will apply force.
position: Vector3#
NotReplicatedDeprecatedReadSafeDeprecated
Deprecated. This is a deprecated variant of BodyPosition.Position which should
be used instead.
Methods 2#
| GetLastForce | Returns the last force in the object. |
| lastForce | Returns the last force in the object.Deprecated |
GetLastForce(): Vector3#
This function returns the last force in the object.
Returns
lastForce(): Vector3#
DeprecatedDeprecated
Deprecated. This property has been superseded by BodyPosition:GetLastForce()
which should be used in new work instead,
The lastForce function returns the last force in the object.
Returns
Events 1#
| ReachedTarget | Fired when the Parent of the BodyPosition reaches the desired
BodyPosition.Position (within .1 studs). Once this event fires it
will not fire again until BodyPosition.Position is updated. |
ReachedTarget()#
Fired when the Parent of the BodyPosition reaches the desired
BodyPosition.Position (within .1 studs). Once this event fires it
will not fire again until BodyPosition.Position is updated.
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