Class
DataModelMesh
NotCreatableNotBrowsable
The DataModelMesh is an abstract class from which mesh classes descend.
The DataModelMesh is an abstract class from which mesh classes descend.
Mesh classes are objects that, when parented to BaseParts
alter the appearance of the part to that of a predefined mesh. Note, they only
alter the appearance of the part and not the physics/collision boundaries of
the part. Developers looking to apply a mesh to a part that alters the part's
collision should use MeshParts.
Note the MeshPart and CharacterMesh classes do not descend
from DataModelMesh.
Properties 3#
OffsetVector3 | The Offset of a mesh determines the relative position from the
BasePart.Position of a BasePart that the mesh will be
displayed at.ReadSafe |
ScaleVector3 | The Scale of a mesh determines the size of the mesh relative to its original dimensions.ReadSafe |
VertexColorVector3 | Changes the hue of a mesh's texture, used with FileMesh.TextureId.ReadSafe |
Offset: Vector3#
ReadSafe
The Offset of a mesh determines the distance from the
BasePart.Position of a BasePart that the mesh will be
displayed.
How to use mesh offset#
The Offset property changes the relative position the mesh will be
rendered at. For example, an offset of 0, 5, 0 will cause the mesh to be
displayed 5 studs above the position of the BasePart.
The position of the BasePart remains unchanged, meaning the
physics collision box of the part will remain in the same location. This
is demonstrated in the image below where the green outline (a
SelectionBox) shows the extents of the BasePart.
Other uses for mesh offset#
There are a number of interesting uses for the mesh offset property.
- Offset and
DataModelMesh.Scalecan be animated usingTweenServicerelatively inexpensively as the engine does not need to make any physics/collision calculations as theBasePartis not moved. - Changing the relationship between the mesh and its collision extents
(determined by the
BasePart)
Scale: Vector3#
ReadSafe
The Scale of a mesh determines the size of the mesh relative to its original dimensions.
How to use mesh scale#
The scale property works slightly differently depending on the type of
mesh being used. Note the size of the BasePart remains unchanged,
meaning the physics collision box of the part will remain the same.
SpecialMeshobjects withSpecialMesh.FileTypeset to 'FileMesh' scale relative to the original dimensions of the mesh when it was uploaded to RobloxBlockMeshobjects orSpecialMeshobjects withSpecialMesh.FileTypeset to 'Brick', 'Wedge' or 'Sphere' scale uniformly relative to theBasePart.Sizeof their parentCylinderMeshobjects orSpecialMeshobjects withSpecialMesh.FileTypeset to 'Cylinder' scale relative to theBasePart.Sizeof their parent. Uniformly for the cylinders height axis and maintaining a 1:1 ratio for the length and width of the cylinder, using the lowest value.SpecialMeshobjects withSpecialMesh.FileTypeset to 'Head' currently scale in a non standard manner. Developers should not rely on this as there are plans to change this behavior.SpecialMeshobjects withSpecialMesh.FileTypeset to 'Torso' scale in a non standard manner. Developers should not rely on this as there are plans to deprecate this mesh type.
Mesh scale demonstration#
The above behavior can be seen in the following demonstration images.
Linear scaling relative to part size for 'Brick', 'Wedge' and 'Sphere' meshes.
Linear scaling relative to original uploaded mesh for 'FileMesh' meshes
Non-uniform constrained scaling for 'Cylinder' meshes
Other uses for mesh scale#
There are a number of interesting uses for the mesh offset property.
DataModelMesh.Offsetand Scale can be animated usingTweenServicerelatively inexpensively as the engine does not need to make any physics/collision calculations as theBasePartis not changed.- Changing the relationship between the mesh and its collision extents
(determined by the
BasePart)
VertexColor: Vector3#
ReadSafe
VertexColor determines the hue change of the
Texture of a FileMesh. Note that this
property is a Vector3 rather than a Color3; to
convert, use the Color3.R, Color3.G, and
Color3.B properties.
Although this property allows basic modification of a texture, changing a
texture entirely provides more control. See MeshPart for more
details.
Inherited members#
Inherited from Instance 58
Properties (10)
Archivable, archivable, Capabilities, IsInSandbox, Name, Parent, PredictionMode, RobloxLocked, Sandboxed, UniqueId
Methods (39)
AddTag, children, ClearAllChildren, Clone, clone, Destroy, destroy, FindFirstAncestor, FindFirstAncestorOfClass, FindFirstAncestorWhichIsA, FindFirstChild, findFirstChild, FindFirstChildOfClass, FindFirstChildWhichIsA, FindFirstDescendant, GetActor, GetAttribute, GetAttributeChangedSignal, GetAttributes, GetChildren, getChildren, GetDebugId, GetDescendants, GetFullName, GetStyled, GetStyledPropertyChangedSignal, GetTags, HasTag, IsAncestorOf, IsDescendantOf, isDescendantOf, IsPropertyModified, QueryDescendants, Remove, remove, RemoveTag, ResetPropertyToDefault, SetAttribute, WaitForChild