# GetHeights(int, int, int, int)

> Gets an array of heightmap samples.

## Definition

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

```csharp
public float[,] GetHeights(int xBase, int yBase, int width, int height)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): First index of heightmap samples to retrieve along the Terrain's x axis.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): First index of heightmap samples to retrieve along the Terrain's z axis.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Number of samples to retrieve along the Terrain's x axis.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Number of samples to retrieve along the Terrain's z axis.

### Returns

| Type                                                               | Description |
| ------------------------------------------------------------------ | ----------- |
| [float\[,\]](https://learn.microsoft.com/dotnet/api/system.single) |             |

### Remarks

Returns a two dimensional array of heightmap samples. The samples are represented as float values ranging from 0 to 1. The array has the dimensions \[height,width] and is indexed as \[y,x].
