# GetIndexCount

> Gets the index count of the given /sub-mesh/. If the mesh contains Mesh LODs, the index count of LOD0.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.6/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

## GetIndexCount(int)

Gets the index count of the given /sub-mesh/. If the mesh contains Mesh LODs, the index count of LOD0.

```csharp
public uint GetIndexCount(int submesh)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The index of the sub-mesh to get the indices for. See [subMeshCount](/engine/6000.6/script-reference/unityengine/mesh/submeshcount.md).

### Returns

| Type                                                         | Description      |
| ------------------------------------------------------------ | ---------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | The index count. |

### Remarks

Additional Resources: [Mesh.SetIndices](/engine/6000.6/script-reference/unityengine/mesh/setindices.md), [Mesh.GetIndexStart](/engine/6000.6/script-reference/unityengine/mesh/getindexstart.md).

## GetIndexCount(int, int)

Gets the index count of the given /sub-mesh/ and level of detail. When meshlod has a value of -1, this returns the index count for the specified sub-mesh (which can include multiple LODs).

```csharp
public uint GetIndexCount(int submesh, int meshLod)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The index of the sub-mesh to get the indices for. See [subMeshCount](/engine/6000.6/script-reference/unityengine/mesh/submeshcount.md).**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The Mesh LOD index. A value of -1 gets the count for the sub-mesh.

### Returns

| Type                                                         | Description      |
| ------------------------------------------------------------ | ---------------- |
| [uint](https://learn.microsoft.com/dotnet/api/system.uint32) | The index count. |
