title | description |
---|---|
Models |
Models are container objects for geometric groupings like parts, Motor6D objects, and other models. |
Models are containers for physical objects, such as parts, welds, and joints that you can use to organize your workspace and group your assets. While models can often contain connected parts, known as an assembly, models can contain any number of individual parts and other objects, such as scripts, and attachments.
Characters, such as avatars or NPCs, are a single Class.Model
containing the appropriate humanoid parts, joints, and additional components:
When you group objects together, they automatically become a Class.Model
object.
-
In the 3D viewport or the Explorer window, select every object that you want to group into a model.
-
Right-click on one of the objects and select Group, or press CtrlG on Windows or ⌘G on Mac. A new
Class.Model
object displays with all of the objects that make up the model nested underneath.
If you have a model with parts that are joined together through physical joints like Class.WeldConstraint|WeldConstraints
or Class.Motor6D|Motor6Ds
, you should specify a Class.BasePart
within the model to become a Class.Model.PrimaryPart|PrimaryPart
. A model's Class.Model.PrimaryPart|PrimaryPart
is the physical reference that specifies which Class.BasePart
the pivot point and bounding box should move with when the model changes position or orientation.
To set a primary part:
- In the Explorer window, select a model.
- In the Properties window, select the PrimaryPart property. Your cursor changes.
- Back in the Explorer window, select the
Class.BasePart
that you want to become your primary part.
As you hover over models in the viewport, they are outlined to indicate their potential selection. You can select an outlined model by clicking it, or you can select multiple models by holding Shift, Ctrl, or ⌘ as you hover over and click them.
As models typically contain multiple child parts or meshes, some children may be hidden from view. To select a specific child without moving the camera around or locating the child in the Explorer hierarchy, click while holding Alt on Windows or ⌥ on Mac to perform selection cycling.
Selection cyclingYou can move, scale, or rotate a model using the Studio transform tools within the Home and Model tabs. Unless you've set a primary part, a model transforms based on the center of its bounding box.
Additionally, within a Class.Script
or Class.LocalScript
, you can move or rotate a model through the following methods:
Method | Description |
---|---|
`Class.Model:MoveTo()|MoveTo()` | Moves the model's `Class.Model.PrimaryPart|PrimaryPart` to the given position. If a primary part has not been specified, the root part of the model will be used. |
`Class.PVInstance:PivotTo()|PivotTo()` | Transforms the model along with all of its descendant `Class.PVInstance|PVInstances` such that the pivot is located at the specified `Datatype.CFrame`. |
`Class.Model:TranslateBy()|TranslateBy()` | Shifts a model by the given `Datatype.Vector3` offset, preserving the model's orientation. |
While models act similarly to Class.Folder
objects for most purposes in your experience, they also exhibit some unique behaviors.
When a Class.Humanoid
is present inside a model that contains a Class.Part
named Head, Roblox displays a name and/or health bar above that part. For more information, see Character Name/Health Display.
To prevent parts that have fallen off of an experience's map from continuing to fall forever, Studio automatically destroys parts that fall below the Class.Workspace.FallenPartsDestroyHeight
value. If a part destroyed due to this behavior is the last part in a model, then that model will also be destroyed.
Instance streaming dynamically loads and unloads Class.Model|Models
on a player's device as their character explores the 3D world. With streaming enabled, you can specify the way each model should be treated under streaming behavior. For example, a model set to Persistent will never stream out, or a model set to Atomic will stream in and out as a single unit with all of its descendants.
Because 3D content that exists on the client changes dynamically in a streaming-enabled experience, models may suddenly disappear. To alleviate this, you can set specific models to render as lower resolution "imposter" meshes when streamed out, as detailed in Model Level of Detail.
See Model Streaming Controls for more on model-level streaming controls.
You can publish models to the Creator Store for other creators to use within their own experiences. As with any asset, all models must adhere to the Community Rules, Terms of Use, and the DMCA Guidelines regarding copyright.