terrain-set-tree-prototypes

Replaces a Unity Terrain's tree prototypes with TreePrototypes built from prefab asset paths.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires unity-mcp-cli.

What problem does it solve? Manually rebuilding a Unity Terrain's tree prototype list in the editor is repetitive and error-prone, especially when swapping vegetation sets across scenes. This Skill replaces all tree prototypes on a Terrain in one call using prefab asset paths. ## Core Features & Use Cases - Bulk Prototype Replacement: Builds a TreePrototype for each provided prefab/GameObject asset path and assigns the full array to TerrainData.treePrototypes. - Editor Integration: Marks the TerrainData dirty and repaints so changes persist and appear immediately in the Unity Editor. - Result Reporting: Returns the new prototype count along with references to the Terrain GameObject and component. - Use Case: When re-theming a level from coniferous to tropical vegetation, pass the new tree prefab paths to swap the entire prototype set in a single operation. ## Quick Start Ask the AI to replace the tree prototypes of the Terrain on a given GameObject with a list of prefab asset paths such as Assets/Trees/Palm.prefab.

Frequently Asked Questions about terrain-set-tree-prototypes

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

FAQPage Schema
How do I change tree prototypes on a Unity Terrain programmatically?▼

Call the terrain-set-tree-prototypes tool with a reference to the GameObject hosting the Terrain and a list of prefab asset paths. Each path becomes a TreePrototype, the array is assigned to TerrainData.treePrototypes, and the new prototype count is returned.

How to replace Unity terrain trees using prefab asset paths?▼

Provide the prefab or GameObject asset paths (starting with Assets/) as the prefabAssetPaths input along with the Terrain's GameObject reference. The tool loads each prefab, builds TreePrototypes, and assigns them to the terrain in one operation.

Does replacing tree prototypes remove existing placed trees?▼

Yes, this operation is destructive: it replaces the entire treePrototypes array, so existing placed tree instances may become invalid and need re-placing. Back up or re-scatter tree instances after swapping prototypes.

What input does the terrain tree prototype tool require?▼

It requires gameObjectRef, identifying the GameObject with the Terrain component by instanceID, hierarchy path, or name, and prefabAssetPaths, a non-empty array of prefab asset paths. Both parameters are mandatory.

Why is unity-mcp-cli not found when running the tool?▼

The CLI is not installed or not on your PATH. Install it globally with npm install -g unity-mcp-cli or invoke it via npx unity-mcp-cli, then retry the run-tool command.