Skip to content

Format

typescript
Mesh.subMeshCount

class: Mesh

Description

The number of submeshes in a Mesh object.

Each submesh corresponds to a Material in the Renderer, such as MeshRenderer or SkinnedMeshRenderer. A submesh is a list of triangles that reference a set of vertices. Vertices can be shared between multiple submeshes.

Parameters

param_nametypedescription

Return

typedescription
number

Code Example

typescript
let mesh = Resources.Load<Mesh>(Mesh, "meshId");
mesh.subMeshCount;