terrain
Create and modify Unity terrains: paint height and textures with brush, add trees and details, flatten, manage layers and rendering settings.
Instructions
Manage Unity Terrains. Actions:
create: Create a new terrain with specified size and resolution
get_info: Get terrain details (size, resolution, layers, trees, details)
set_height: Set terrain height at a world position with brush radius
get_height: Sample terrain height at a world position
flatten: Flatten entire terrain to a uniform height
set_detail: Paint detail/grass density at a position
paint_texture: Paint a terrain layer/texture at a position
add_tree: Add a tree instance at a normalized (0-1) position
get_layers: List all terrain layers (textures)
add_layer: Add a new terrain layer from a texture asset
set_settings: Modify terrain rendering settings
list: List all terrains in the scene
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | World X position or detail/alphamap X coordinate | |
| z | No | World Z position or detail/alphamap Z coordinate | |
| layer | No | Terrain layer index or detail layer index | |
| scale | No | Tree scale | |
| width | No | Terrain width (create) | |
| action | Yes | Terrain action to perform | |
| height | No | Terrain height / max elevation (create/set_height/flatten) | |
| length | No | Terrain length (create) | |
| radius | No | Brush radius | |
| density | No | Detail density value | |
| strength | No | Paint strength 0-1 | |
| tileSize | No | Texture tile size for add_layer | |
| assetPath | No | Path to save terrain data asset | |
| layerPath | No | Path to save the TerrainLayer asset | |
| terrainId | No | Instance ID of the terrain | |
| terrainName | No | Name of the terrain GameObject | |
| texturePath | No | Texture asset path for add_layer | |
| treeDistance | No | Max tree rendering distance | |
| drawHeightmap | No | Enable/disable heightmap rendering | |
| prototypeIndex | No | Tree prototype index | |
| basemapDistance | No | Distance for basemap rendering | |
| drawTreesAndFoliage | No | Enable/disable trees and foliage | |
| heightmapPixelError | No | Heightmap pixel error for LOD | |
| heightmapResolution | No | Heightmap resolution (create, power of 2 + 1) | |
| detailObjectDistance | No | Max detail object distance | |
| treeBillboardDistance | No | Distance to switch trees to billboards |