Class
SpecialMesh
The SpecialMesh object applies a mesh to a BasePart depending
on the MeshType property.
The SpecialMesh object applies a mesh to a BasePart depending
on the MeshType property. A number of options are
available.
- Brick - A block shape, equivalent to a
BlockMesh - Cylinder - A cylinder, identical to a
Partwith aPart.Shapeof 'Cylinder' - FileMesh - A user uploaded Mesh, equivalent to
FileMeshthat a texture can be applied to using theFileMesh.TextureIdproperty - Head - A character head shape
- Sphere - A sphere shape, similar to a
Partwith aPart.Shapeof 'Ball' but can be freely resized on all axis - Wedge - A wedge shape, identical to a
WedgePart - Torso - A block with sloped sides, due to be deprecated
Note, each SpecialMesh.MeshType will scale differently when using
DataModelMesh.Scale, for more information on this please see the page
on DataModelMesh.Scale. The SpecialMesh object also exposes the
DataModelMesh.Offset property.
It is important to remember that when using a SpecialMesh, only the appearance of a part changes. The collision model of the part remains the same. For example, a character will not be able to walk correctly over a mesh as the mesh geometry is not taken into account.
SpecialMesh vs MeshPart#
There are currently two ways of using a developer created mesh. They are using
a SpecialMesh with the SpecialMesh.FileType set to 'FileMesh', or by
using a MeshPart. Although, on the whole, the MeshPart object
has superseded the SpecialMesh there are some differences developers should be
aware of.
BasePart.Materialdisplays correctly on the mesh when using aMeshPartand not when using a SpecialMeshMeshPartsinclude theMeshPart.CollisionFidelityproperty, meaning the collision model of aMeshPartcan be set to resemble the geometry of the mesh. The SpecialMesh object by contrast, uses the parentBasePartscollision model- The mesh of a
MeshPartscales on all axis depending on theSizeproperty of theMeshPart, the mesh of a SpecialMesh does not - The SpecialMesh object includes the
OffsetandScaleproperties whereasMeshPartsdo not - The
MeshIdproperty of aSpecialMeshcan be changed by aScriptorLocalScriptduring runtime. TheMeshIdproperty of aMeshPartcan not.
Properties 1#
MeshTypeMeshType | Determines the type of mesh that will be applied to the BasePart
the SpecialMesh is parented to.ReadSafe |
MeshType: MeshType#
ReadSafe
The mesh that the SpecialMeshobject applies to the
BasePart depends on the MeshType property. A number of options are
available.
- Brick - A block shape, equivalent to a
BlockMesh - Cylinder - A cylinder, identical to a
Partwith aPart.Shapeof 'Cylinder' - FileMesh - A user uploaded Mesh, equivalent to
FileMeshthat a texture can be applied to using theFileMesh.TextureIdproperty - Head - A character head shape
- Sphere - A sphere shape, similar to a
Partwith aPart.Shapeof 'Ball' but can be freely resized on all axis - Wedge - A wedge shape, identical to a
WedgePart - Torso - A block with sloped sides, due to be deprecated
Note, each MeshType will scale differently when using
DataModelMesh.Scale, for more information on this please see the
page on DataModelMesh.Scale.
Inherited members#
Inherited from FileMesh 4
Properties (4)
Inherited from DataModelMesh 3
Properties (3)
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