A model is a construct used to group parts and other objects together while also allowing manipulation of multiple objects.


Pubfield BasePart PrimaryPart

A Part that serves as a reference for the Model's CFrame. Used in conjunction with GetModelPrimaryPartCFrame and SetModelPrimaryPartCFrame. Use this to rotate/translate all Parts relative to the PrimaryPart.

Category: Data.

Serialization: can save and load.


Pubmethod void BreakJoints()

Breaks all surface joints contained within.

Pubmethod Tuple GetBoundingBox()

Pubmethod Vector3 GetExtentsSize()

Pubmethod CFrame GetModelCFrame()

Returns a CFrame that has position of the centroid of all Parts in the Model. The rotation matrix is either the rotation matrix of the user-defined PrimaryPart, or if not specified then a part in the Model chosen by the engine.

Tags: Deprecated.

Pubmethod Vector3 GetModelSize()

Returns a Vector3 that is union of the extents of all Parts in the model.

Tags: Deprecated.

Pubmethod CFrame GetPrimaryPartCFrame()

Returns the cframe of the Model.PrimaryPart. If PrimaryPart is nil, then this function will throw an error.

Pubmethod void MakeJoints()

Creates the appropriate SurfaceJoints between all touching Parts contained within the model. Technically, this function calls MakeJoints() on all Parts inside the model.

Pubmethod void MoveTo(Vector3 position)

Moves the centroid of the Model to the specified location, respecting all relative distances between parts in the model.

Pubmethod void ResetOrientationToIdentity()

Rotates all parts in the model to the orientation that was set using SetIdentityOrientation(). If this function has never been called, rotation is reset to GetModelCFrame()'s rotation.

Tags: Deprecated.

Pubmethod void SetIdentityOrientation()

Takes the current rotation matrix of the model and stores it as the model's identity matrix. The rotation is applied when ResetOrientationToIdentity() is called.

Tags: Deprecated.

Pubmethod void SetPrimaryPartCFrame(CFrame cframe)

Sets the cframe of the Model.PrimaryPart. If PrimaryPart is nil, then this function will throw an error. This also sets the cframe of all descendant Parts relative to the CFrame change to PrimaryPart.

Pubmethod void TranslateBy(Vector3 delta)

Similar to MoveTo(), except instead of moving to an explicit location, we use the model's current CFrame location and offset it.

Pubmethod void breakJoints()

Tags: Deprecated.

Pubmethod void makeJoints()

Use MakeJoints() instead.

Tags: Deprecated.

Pubmethod void move(Vector3 location)

Use MoveTo() instead.

Tags: Deprecated.

Pubmethod void moveTo(Vector3 location)

Tags: Deprecated.

External links

Community content is available under CC-BY-SA unless otherwise noted.