# GetMaxDetailInstancesPerPatch(TerrainData)

> Gets the max amount of detail instances per patch allowed on a terrain.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.TerrainTools](/engine/6000.6/script-reference/unityeditor/terraintools.md)
* **Assembly:** UnityEditor

```csharp
public static int GetMaxDetailInstancesPerPatch(TerrainData terrainData)
```

### Parameters

**** (\[TerrainData]\(/engine/6000.6/script-reference/unityengine/terraindata)): The terrain data object.

### Returns

| Type                                                       | Description                                 |
| ---------------------------------------------------------- | ------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | Returns the max number of detail instances. |
