Roblox UtilitiesDevlHub Roblox Documentation

Class

PVInstance

NotCreatableNotBrowsable
Inherits
Instance › Object
Memory category
Instances
Subclasses
3

Abstract class for all objects that have a physical location in the world.

A PVInstance is an abstract class that cannot be created. It is the base for all objects that have a physical location in the world.

Properties 2#

OriginCFrameEditor-only property that reads and sets the world CFrame of the PVInstance's pivot, moving the entire instance when changed from the Studio Properties window.ReadSafeNotReplicatedNotScriptable
Pivot OffsetCFrameEditor-only property that displays and edits the pivot's CFrame relative to the instance, moving only the pivot and leaving the instance in place.ReadSafeNotReplicatedNotScriptable

Origin: CFrame#

NotReplicatedNotScriptableReadSafe

Editor-only property, shown in the Studio Properties window as Origin Position and Origin Orientation under Transform. Its value is the world-space CFrame of the instance's pivot; reading it returns the same CFrame as PVInstance:GetPivot(). It has no stored value of its own and always reflects the current pivot.

Setting it from the Properties window moves the whole instance so its pivot lands at the new CFrame, much like PVInstance:PivotTo(). Editing through the Properties window temporarily disables WeldConstraints to other objects for the move; PivotTo does not modify joints.

Not available to scripts; use PVInstance:GetPivot() and PVInstance:PivotTo() at runtime instead.

Pivot Offset: CFrame#

NotReplicatedNotScriptableReadSafe

Editor-only property, shown in the Studio Properties window as Pivot Position and Pivot Orientation under Pivot. It is the CFrame of the pivot relative to the instance's own frame.

Changing it from the Properties window moves the pivot relative to the instance while leaving the instance in place, unlike Origin, which moves the whole instance. For a BasePart, the offset defaults to the identity CFrame, so the pivot coincides with the part's center. For a Model, this property appears only when the model has a PrimaryPart; it then reflects and edits that part's PivotOffset, and Model:GetPivot() aliases the primary part's pivot.

Not available to scripts; scripts read and write the equivalent through the concrete class, such as BasePart.PivotOffset.

Methods 2#

GetPivotGets the pivot of a PVInstance.Safe
PivotToTransforms the PVInstance along with all of its descendant PVInstances such that the pivot is now located at the specified CFrame.

GetPivot(): CFrame#

Safe

This function gets the pivot of a PVInstance. This is often used with PVInstance:PivotTo() to move a model.

Models and BaseParts are both PVInstances ("Position Velocity Instances") and so both have this function.

Returns

PivotTo(targetCFrame: CFrame): ()#

Transforms the PVInstance along with all of its descendant PVInstances such that the pivot is now located at the specified CFrame. This is the primary function that should be used to move Models via scripting.

BaseParts are moved in this way by having their CFrame transformed by the necessary offset. Models are moved in this way by having their Model.WorldPivot transformed by the necessary offset.

Note that for efficiency purposes, Object.Changed events are not fired for Position and Orientation of BaseParts moved in this way; they are only fired for CFrame.

When calling PivotTo on Models, the offsets of the descendant parts and models are cached, such that subsequent calls to PivotTo on the same model do not accumulate floating point drift between the parts making up the model.

Models and BaseParts are both PVInstances ("Position Velocity Instances") and so both have this function.

NameTypeDefaultDescription
targetCFrameCFrameThe CFrame that the PVInstance pivot should equal after moving it.
Returns
  • ()

Inherited members#

Inherited from Instance 58
Inherited from Object 6
Properties (2)

ClassName, className

Events (1)

Changed

Subclasses 3#