terrain-place-trees

Places tree instances on a Unity Terrain using normalized positions or random scatter.

Updated May 20, 2026
One-click install
npx skills add https://github.com/Alltwice/Unity-3D-Project --skill terrain-place-trees-alltwice
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: terrain-place-trees
Source: https://github.com/Alltwice/Unity-3D-Project/tree/main/.agents/skills/terrain-place-trees
Command: npx skills add https://github.com/Alltwice/Unity-3D-Project --skill terrain-place-trees-alltwice

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires unity-mcp-cli.

What problem does it solve? Manually populating a Unity Terrain with trees is slow and imprecise, especially when you need hundreds of instances placed within specific regions or at exact coordinates. This Skill programmatically adds TreeInstances to a Terrain via the unity-mcp-cli, either scattering them randomly or placing them at explicit positions. ## Core Features & Use Cases - Random Scatter Placement: Distribute a configurable number of trees across a normalized [0,1] sub-rectangle of the terrain. - Explicit Position Placement: Supply exact normalized XZ positions (Vector2 list) to override random scattering for precise layouts. - Scale and Cleanup Control: Set per-instance height/width scale and optionally clear existing trees before placing new ones. - Use Case: A level designer wants 200 pine trees scattered only in the northern half of a terrain. They set minZ to 0.5, count to 200, and the correct prototypeIndex, and the terrain is populated in one call with heights sampled automatically. ## Quick Start Ask the AI to scatter 100 trees of prototype index 0 across the Terrain on your chosen GameObject using the terrain-place-trees tool.

Frequently Asked Questions about terrain-place-trees

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

FAQPage Schema
How do I scatter trees on a Unity Terrain programmatically?▼

Use the terrain-place-trees tool with a gameObjectRef pointing to the Terrain's GameObject, a prototypeIndex, and a count. Trees are scattered randomly within a normalized [0,1] rectangle defined by minX, minZ, maxX, and maxZ, with heights sampled automatically.

How to place trees at exact positions on Unity Terrain?▼

Provide the positions parameter as an array of Vector2 values with normalized [0,1] coordinates, where x maps to terrain X and y maps to terrain Z. When positions is supplied, it overrides the random scatter behavior entirely.

Why does terrain-place-trees fail with a prototype index error?▼

The prototypeIndex must reference a tree prototype that already exists on the terrain's TerrainData. Add the tree prototype to the Terrain first, then pass its zero-based index to the tool.

Can I remove existing trees before placing new ones in Unity?▼

Yes, set the clearExisting parameter to true and the tool removes all current tree instances before placing the new ones. The default is false, which appends new trees to the existing set.

What coordinate system does Unity Terrain tree placement use?▼

Tree positions use normalized [0,1] coordinates across the terrain surface, not world units. The tool samples the terrain height at each normalized position and assigns instances via TerrainData.SetTreeInstances with snapToHeightmap enabled.