MeshPart

Show Deprecated

MeshPart is a form of BasePart that includes a physically simulated custom mesh. Unlike with other mesh classes, such as SpecialMesh and BlockMesh, they are not parented to a BasePart but rather behave as a BasePart in their own right.

The mesh and texture of a MeshPart are determined by the MeshId and TextureID properties. For more information, see Meshes.

Summary

Properties

Properties inherited from TriangleMeshPartProperties inherited from BasePartProperties inherited from PVInstance

Methods

Methods inherited from BasePartMethods inherited from PVInstance

Events

Events inherited from BasePart

Properties

DoubleSided

read parallel

This property determines whether to render both faces or polygons in the mesh. It is only changeable in Studio. This is useful for meshes that are typically modeled as cards such as a leaf, hair and cloth.

Example: The tree leaves are modeled with single sided cards.

Leaves as cards

With MeshPart.DoubleSided disabled some leaves are missing since they are back facing the camera.

DoubleSided property disabled

With MeshPart.DoubleSided enabled, both faces of the leaves are rendered.

DoubleSided property enabled

HasJointOffset

hidden
read parallel

HasSkinnedMesh

hidden
read parallel

JointOffset

hidden
read parallel

MeshId

read parallel

The MeshId is the content ID of the mesh that is to be displayed on the MeshPart.

Note that this property currently cannot be changed by scripts as the collision model of the mesh cannot be recomputed during runtime. Developers should not rely on this behavior as it may change in the future. Those looking for a custom mesh object that can be updated during runtime should use SpecialMesh.

RenderFidelity

not replicated
read parallel

This property determines the level of detail that the MeshPart will be shown in. It can be set to the possible values of the Enum.RenderFidelity enum.

By default, MeshParts will always be shown in precise fidelity, no matter how far they are from the camera. This improves their appearance when viewed from any distance, but if a place has a large number of detailed mesh parts, it may reduce overall performance.

Distance From CameraRender Fidelity
Less than 250 studsHighest
250-500 studsMedium
500 or more studsLowest

TextureID

read parallel

The texture applied to the MeshPart. When this property is set to an empty string, no texture will be applied to the mesh.


MeshPart.TextureID = "" -- no texture

Note, although the MeshPart.MeshId property cannot be changed during runtime, the texture can.

How can I change the texture of a mesh?

Using the TextureId property, the texture of a mesh can be changed without having to reupload the mesh. To do this, a new image will need to be uploaded to Roblox with the desired texture. The original texture image file can be obtained by exporting the mesh using the 'Export Selection' option in Roblox Studio. The image file will be saved alongside the exported .obj file.

The new texture can then be re-uploaded to Roblox as a Decal and its content ID can be applied to the mesh using the TextureId property.

How can I make a textured mesh?

A mesh can only be textured if the mesh has been UV mapped. UV mapping refers to the practice of projecting a texture map onto a mesh. This cannot be done using Roblox Studio and has to be done using an external 3D modelling application such as Blender.

Methods

ApplyMesh

void

Parameters

meshPart: Instance

Returns

void

Events