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
Plugin Security

This property determines whether to render both faces of 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, or cloth.

HasJointOffset

Hidden
Read Parallel
Not Accessible Security

HasSkinnedMesh

Hidden
Read Parallel
Not Accessible Security

JointOffset

Hidden
Read Parallel
Not Accessible Security

MeshId

ContentId
Read Parallel
Not Accessible Security

Content ID of the mesh that is 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. See InsertService:CreateMeshPartAsync() as a method to create a new MeshPart from a given MeshId and with a specified CollisionFidelity and RenderFidelity.

RenderFidelity

Not Replicated
Read Parallel
Plugin Security

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.

The default value is Automatic, meaning the mesh's detail is based on its distance from the camera as outlined in the following table.

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

TextureID

ContentId
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