Skip to content

Class · inherits Instance

PVInstance

Official docs ↗

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

About PVInstance

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

  • Origin: CFrameNotReplicatedNotScriptableEditor-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.

    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: CFrameNotReplicatedNotScriptableEditor-only property that displays and edits the pivot's CFrame relative to the instance, moving only the pivot and leaving the instance in place.

    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

  • GetPivot() → CFrameGets the pivot of a PVInstance.

    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.

  • PivotTo(targetCFrame: CFrame) → ()Transforms the PVInstance along with all of its descendant PVInstances such that the pivot is now located at the specified 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.

PVInstance also has every member of Instance. 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.