MeshPart

Mostrar obsoleto

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.

Resumen

Propiedades

Propiedades heredados de TriangleMeshPartPropiedades heredados de BasePartPropiedades heredados de PVInstance

Métodos

Métodos heredados de BasePartMétodos heredados de PVInstance

Eventos

Eventos heredados de BasePart

Propiedades

DoubleSided

leer paralelo
seguridad del plugin

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

oculto
leer paralelo
seguridad no accesible

HasSkinnedMesh

oculto
leer paralelo
seguridad no accesible

JointOffset

oculto
leer paralelo
seguridad no accesible

MeshId

leer paralelo
seguridad no accesible

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

no replicado
leer paralelo
seguridad del plugin

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

leer paralelo

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.

Métodos

ApplyMesh

void

Parámetros

meshPart: Instance

Devuelve

void

Eventos