---
title: TerrainLayerPaintRule
product: Unity Editor
version: '7000.0'
latest_version: '7000.0'
status: This page documents version 7000.0. The latest version is 7000.0.
canonical: https://docs.unity.com/en-us/engine/7000.0/script-reference/unityeditor/terraintools/terrainlayerpaintrule
latest_url: https://docs.unity.com/en-us/engine/7000.0/script-reference/unityeditor/terraintools/terrainlayerpaintrule.md
last_updated: 2026-10-20
generated_at: 2026-11-11T15:44:57.728Z
locale: en-us
---

# TerrainLayerPaintRule

> One rule of TerrainEditUtility.PaintLayers: paint a layer where the height and the slope lie in their ranges.

## Definition

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

```csharp
public sealed class TerrainLayerPaintRule
```

## Constructors

| Constructor                                                                                                                   | Description                                                                  |
| ----------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| [TerrainLayerPaintRule(System.Int32)](/engine/7000.0/script-reference/unityeditor/terraintools/terrainlayerpaintrule/ctor.md) | Creates a rule that paints a layer everywhere in the region at full opacity. |

## Properties

| Property                                                                                                     | Description                                                                                                                                             |
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [heightRange](/engine/7000.0/script-reference/unityeditor/terraintools/terrainlayerpaintrule/heightrange.md) | Paint only where the height, in meters above the base of the Terrain, lies within \[x, y]. Unbounded by default.                                        |
| [layerIndex](/engine/7000.0/script-reference/unityeditor/terraintools/terrainlayerpaintrule/layerindex.md)   | The index of the layer in [TerrainData.terrainLayers](/engine/7000.0/script-reference/unityengine/terraindata/terrainlayers.md).                        |
| [opacity](/engine/7000.0/script-reference/unityeditor/terraintools/terrainlayerpaintrule/opacity.md)         | The opacity, from 0 to 1. See [TerrainLayerBlendMode](/engine/7000.0/script-reference/unityeditor/terraintools/terrainlayerblendmode.md). 1 by default. |
| [slopeRange](/engine/7000.0/script-reference/unityeditor/terraintools/terrainlayerpaintrule/sloperange.md)   | Paint only where the slope, in degrees, lies within \[x, y]. \[0, 90] by default.                                                                       |
