unity-terrain

Create and sculpt Unity Terrain heightmaps, generate Perlin noise landscapes, and paint texture layers.

Updated Jun 21, 2026
One-click install
npx skills add https://github.com/du-qwq/Shader-Writing-Architecture-and-Specifications --skill unity-terrain-du-qwq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-terrain
Source: https://github.com/du-qwq/Shader-Writing-Architecture-and-Specifications/tree/main/.agents/skills/unity-skills/skills/terrain
Command: npx skills add https://github.com/du-qwq/Shader-Writing-Architecture-and-Specifications --skill unity-terrain-du-qwq

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building natural-looking terrain in Unity by hand is slow and error-prone, requiring manual heightmap editing, noise generation, and texture painting through the editor UI. This Skill exposes programmatic terrain operations so an AI assistant can create TerrainData, sculpt heights, and paint texture layers directly in a Unity scene. ## Core Features & Use Cases - Terrain Creation & Querying: Create a Terrain GameObject with TerrainData at a chosen size and resolution, then query size, layers, and height at any world position. - Sculpting & Generation: Add smooth hills, generate natural landscapes with multi-octave Perlin noise, smooth sharp edges, flatten plateaus, or batch-set heights from a 2D array. - Texture Painting: Paint terrain texture layers at normalized coordinates with configurable brush size and strength. - Use Case: Ask the assistant to build a 200x200 terrain with rolling Perlin hills, flatten a plateau at the center for a base, and paint a grass layer around it — all in one conversation, with workflow undo/redo support. ## Quick Start Create a 200 by 200 Unity terrain named MyTerrain, generate rolling Perlin noise hills on it, then smooth the center region.

Frequently Asked Questions about unity-terrain

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create terrain in Unity programmatically?

Use terrain_create with a name, width, length, height, and heightmap resolution to spawn a Terrain GameObject with a TerrainData asset. It returns the instance ID, asset path, size, and position for follow-up operations.

How to generate natural-looking terrain with Perlin noise in Unity?

Call terrain_generate_perlin with scale, heightMultiplier, octaves, persistence, and lacunarity to shape the landscape. Lower scale gives larger features, more octaves add detail, and a fixed seed makes results reproducible.

Can I set Unity terrain heights from a heightmap array?

Yes, terrain_set_heights_batch accepts a 2D float array indexed [z][x] with values from 0 to 1, plus startX and startZ pixel offsets. There is no terrain_import_heightmap skill, so batch height setting is the supported approach.

Does this skill support adding trees or grass to Unity terrain?

No, terrain_add_tree and terrain_add_grass do not exist in this module. Trees and grass details require Unity Terrain tools or custom scripts; this skill covers heights, smoothing, flattening, and texture layer painting only.

Why does terrain_paint_texture fail on my terrain?

Painting requires terrain layers to already be configured on the TerrainData. Use terrain_get_info to check terrainLayerCount and available layer indices, then pass a valid 0-based layerIndex with your brush parameters.

Can terrain operations be undone in Unity?

Yes, all terrain operations integrate with workflow sessions. Wrap edits between workflow_session_start and workflow_session_end, then call workflow_session_undo with the session ID to revert the entire terrain change set.