Model

Model : PVInstance

Overview

A Model is a container that groups multiple objects for management, which is mainly used to handle collections of BaseParts.

It is deal for grouping parts that are related in position or structure. If you want to group elements that do not have a physical form, such as scripts, using a Folder is more appropriate.

It supports applying physical effects collectively to the grouped objects, while allowing operations such as moving, rotating, or deleting them. This enables treating multiple objects as a single unit without controlling each one individually.

Properties

PrimaryPart

BasePart

This property designates the BasePart that serves as the reference for the model.

The target designated as the PrimaryPart must be a BasePart that is child of the model. A BasePart that is not a child cannot be assigned.

For a Character Model, the PrimaryPart is the HumanoidRootPart.

Code Samples

local Model = script.Parent

Model.PrimaryPart = Model.Part

WorldPivot

CFrame

Defines the pivot point of rotation for a model that does not have a PrimaryPart. If the model has a PrimaryPart, the pivot is replaced by that part's reference point, and this property is ignored.

Code Samples

Methods

BreakJoints

Currently not supported.

Parameters

Return

void

Code Samples

MoveTo

Moves all BaseParts within a Model instantly to a specified target position, based on the Modelโ€™s current pivot, regardless of whether the parts are Anchored. If there are obstacles such as other BaseParts at the target position, the Model automatically adjusts upward to avoid overlapping.

Since MoveTo only affects position, the Modelโ€™s rotation remains unchanged even after reaching the target position.

Parameters

Vector3 InPosition

The coordinates of the target position to move to.

Return

void

Code Samples

PivotTo

Currently not supported.

Parameters

CFrame InTargetCFrame

Return

void

Code Samples

SetPrimaryPartCFrame

A feature used to specify the position and rotation of a PrimaryPart that works as the center of a model.

When the PrimaryPart's CFrame changes, all parts included in the model move accordingly, while maintaining their relative orientation and distance from the PrimaryPart. In other words, it is the core mechanism used to move or rotate the entire model at once.

However, an error occurs if this function is called for a model without PrimaryPart.

Parameters

CFrame InNewCFrame

The CFrame to set.

Return

void

Code Samples

Events

Last updated