Model
Groups instances for movement, cloning, and destruction.
- Creatable
Instance.new("Model")- Inherits
- PVInstanceInstance
- Replication
- Standard
Behavior
Model groups instances and supports a shared pivot. PivotTo moves descendant
parts together. The pivot uses PrimaryPart when set, or model bounds otherwise.
Pivot operations require model contents.
Summary
The policy for reducing rendering detail at a distance.
The optional descendant part used as the model pivot reference.
The distance limit used to cull the Model.
The model pivot in world space.
Returns the Model's bounding transform and dimensions.
Returns this instance if it is an ExecutionGroup.
Returns the dimensions of the Model's bounds.
Returns the current pivot as a CFrame.
Returns the rig-joint information for the Model.
Returns the current scale factor relative to the original model size.
Moves the Model to the supplied world-space position.
Moves and rotates descendant parts so the model pivot matches the supplied CFrame.
Sets the Model's overall scale factor.
Translates the Model by a world-space offset.
Properties
LevelOfDetail
Model.LevelOfDetail: Enum.ModelLevelOfDetail = Enum.ModelLevelOfDetail.AutomaticThe policy for reducing rendering detail at a distance.
PrimaryPart
Model.PrimaryPart: BasePart? = nilThe optional descendant part used as the model pivot reference. Assigning a non-descendant produces an error. Without a primary part, the pivot derives from model bounds and the pivot offset.
VisibilityRange
Model.VisibilityRange: number = 0The distance limit used to cull the Model.
WorldPivot
Model.WorldPivot: CFrame = CFrame.new(0, 0, 0)The model pivot in world space. Assignment changes the pivot offset without moving the model parts. A model without usable contents produces an error.
Methods
GetBoundingBox
Returns the Model's bounding transform and dimensions.
GetExecutionGroup
Model:GetExecutionGroup(): ExecutionGroup?Returns this instance if it is an ExecutionGroup. Otherwise returns the nearest ancestor ExecutionGroup, or nil when no group contains the instance.
GetExtentsSize
Model:GetExtentsSize(): Vector3Returns the dimensions of the Model's bounds.
GetPivot
Model:GetPivot(): CFrameReturns the current pivot as a CFrame. Uses PrimaryPart when assigned, otherwise model bounds, with the pivot offset applied. A model without usable contents produces an error.
GetRigJoints
Model:GetRigJoints(): { RigJointInfo }Returns the rig-joint information for the Model.
GetScale
Model:GetScale(): numberReturns the current scale factor relative to the original model size. A value of 1 represents the original size.
MoveTo
Model:MoveTo(position: Vector3): ()Moves the Model to the supplied world-space position.
PivotTo
Model:PivotTo(targetCFrame: CFrame): ()Moves and rotates descendant parts so the model pivot matches the supplied CFrame. A model without usable contents produces an error. This operation requires serial execution.
ScaleTo
Model:ScaleTo(newScaleFactor: number): ()Sets the Model's overall scale factor.
TranslateBy
Model:TranslateBy(delta: Vector3): ()Translates the Model by a world-space offset.
Inherited members
- Properties
- ArchivableClassNameNameParent
- Methods
- AddComponent()AddTag()ClearAllChildren()ClearTags()Clone()Destroy()FindFirstAncestor()FindFirstAncestorOfClass()FindFirstAncestorWhichIsA()FindFirstChild()FindFirstChildOfClass()FindFirstChildWhichIsA()FindFirstDescendant()GetAttribute()GetAttributeChangedSignal()GetAttributes()GetChildren()GetComponent()GetComponentChangedSignal()GetComponents()GetDebugId()GetDescendants()GetFullName()GetPropertyChangedSignal()GetReferencing()GetTags()HasComponent()HasTag()IsA()IsAncestorOf()IsDescendantOf()RemoveComponent()RemoveTag()SetAttribute()WaitForChild()
- Events
- AncestryChangedAttributeChangedChangedChildAddedChildRemovedDescendantAddedDescendantRemovingDestroying
Example
local model = Instance.new("Model")
local part = Instance.new("Part")
part.Anchored = true
part.Parent = model
model.PrimaryPart = part
model.Parent = workspace
model:PivotTo(CFrame.new(40, 1, 0))