Terrain Height Visualizer & Prefab Placer

A paired set of Unity Editor tools for reading and populating terrain elevation —
analyze your landscape, then bring it to life. By BigBuffaloBill.

Overview home

Author’s Note on Expected Functionality: Please review the Notes on Tool Intent, Status and Author Support document included in each tool’s subdirectory (TerrainHeightSpheres/ and TerrainPrefabPlacer/) before getting started.

This package bundles two terrain editor tools that were built to work together. The first — Terrain Height Spheres — lets you read your terrain. It drops a grid of color-coded spheres across your scene so you can see exactly where the high ground is, where the valleys are, and where any particular elevation band sits, all without leaving the Editor and without touching your scene file. The second — Terrain Prefab Placer — lets you act on what you saw. It uses the exact same elevation filter to scatter prefabs across the terrain surface, restricted to whichever height band you choose, with randomized position, rotation, and scale so the result looks natural.

The tools share a common design language: the same percentile-based height filter, the same grid-spacing model, and the same multi-terrain traversal logic. Once you understand how the height filter works in one tool you know how it works in both. The workflow they enable is intentional — use Height Spheres to explore and identify the elevation zones that matter for your scene, note the percentile values that isolate those zones, then carry those exact values into Prefab Placer to populate them. The two tools are halves of a single pipeline.

Both tools are Editor-only. Neither requires configuration beyond opening a window and setting a few sliders. Neither requires any third-party dependencies. They are lightweight, non-opinionated additions to any terrain-based Unity project.


What’s Included home

Terrain Height Spheres

Visualize terrain elevation as color-coded spheres in the Scene view

  • Yellow-to-red gradient by elevation
  • Configurable grid spacing and sphere size
  • Percentile-based height filter
  • Non-destructive — never saved to scene
  • Settings persisted via EditorPrefs
  • Multi-terrain support
  • Requires URP

Full documentation: TerrainHeightSpheres/

Terrain Prefab Placer

Scatter prefabs across terrain surfaces filtered by elevation

  • Up to 10 prefab slots, randomly selected per placement
  • Configurable grid spacing and scale variance
  • Same percentile-based height filter
  • Objects saved to scene; Bake to commit permanently
  • Unique GUID container per generation
  • Multi-terrain support
  • Any render pipeline

Full documentation: TerrainPrefabPlacer/

Each tool ships as a single .cs file in its own Editor/ subfolder. There are no shared assemblies, no ScriptableObjects, and no runtime components. Importing one tool does not require the other, but they are designed to be used together.


Shared Design: The Height Filter & Grid System home

Because both tools are built on the same core logic, it is worth understanding that logic once rather than twice. The following concepts apply identically to both tools.

The Percentile Height Filter

Each tool has a Bottom Percentile and a Top Percentile slider, each ranging from 0 to 100. Together they define a slice of your terrain’s elevation range to work within. The tool samples all Terrain objects in the scene on each generation pass, computes the global minimum and maximum world-space height across every terrain, and then uses your percentile values to compute absolute height thresholds within that range.

For example, if your terrain spans from 0 m to 200 m and you set the bottom percentile to 60 and the top to 100, the tool operates on heights between 120 m and 200 m — the upper 40% of the elevation range. If you later add a second terrain tile that reaches 400 m, the same percentile settings now resolve to 240–400 m, because the global range has changed. The filter is always relative to whatever terrains are in the scene at generation time.

BottomTopEffect
0100Full terrain — no filter applied
030Valleys and low-lying ground only
4060Mid-elevation band only
70100Upper slopes and ridgelines only
90100Peaks only — narrow high-elevation strip

Grid Spacing

Both tools use a Grid Spacing slider that controls the distance in meters between sample or placement points on the X and Z axes. A value of 100 m means one sample every 100 meters; a value of 10 m means one every 10 meters, producing 100× as many points. Start large and reduce as needed — very small values generate large numbers of objects and can slow the Editor significantly.

In Prefab Placer, each placed object is additionally offset by a random amount within a circle of radius half the grid spacing, which breaks up the regular grid pattern and produces more natural-looking scatter. In Height Spheres, placement is exact on the grid with no offset.

Multi-Terrain Traversal

Both tools use Object.FindObjectsOfType<Terrain> to discover all active terrains in the scene. Every generation pass recomputes the height range from scratch across all discovered terrains. This means both tools work correctly with tiled multi-terrain setups and the height filter is always globally consistent, regardless of how many terrain tiles are present.


Recommended Workflow home

The two tools are designed to be used in sequence. The following workflow takes you from a bare terrain to a populated scene using both tools together.

1

Open Terrain Height Spheres via Tools > BBB > Terrain Height Spheres.

Set Grid Spacing to a coarse value (100–200 m) and click Generate Spheres. You will see the full elevation map of your scene as a yellow-to-red gradient. This is your read of the terrain.

2

Identify your target elevation zones.

Use the Bottom and Top Percentile sliders to isolate the band you want to populate. For example, if you want to place forest on mid-elevation slopes, adjust the sliders until the spheres highlight only those slopes. Note the percentile values.

3

Open Terrain Prefab Placer via Tools > BBB > Terrain Prefab Placer.

Assign your prefabs to the slots, set Grid Spacing and Scale Variance as desired, and enter the same Bottom and Top Percentile values you identified in step 2.

4

Click Generate Objects.

Your prefabs will appear across the same elevation band the spheres were showing. If the result looks right, click Bake Current Objects to commit this pass to the scene permanently.

5

Repeat for additional elevation bands.

Go back to Height Spheres, change the percentile range to isolate a different zone (e.g., the high peaks for rocks and sparse ground cover), note the values, and run another generation pass in Prefab Placer. Bake that pass too. Each baked pass is independent and coexists in the Hierarchy under its own GUID-named container.

Terrain Height Spheres — view only: The spheres are a read-only analysis overlay. They are never written to the scene file and will disappear if you enter Play Mode or close the scene. This is by design — the tool is purely for reading your terrain, not for placing anything in it.

Terrain Prefab Placer — objects land in the scene immediately: Generated prefabs are standard scene GameObjects from the moment you click Generate. They can be removed at any time using the Remove Objects button, or deleted directly from the Hierarchy using the standard Editor delete. Once you click Bake Current Objects, the tool releases its reference to that container — the objects remain in the scene permanently but the tool no longer tracks them. The same applies if you leave the scene and return: the container reference is lost, and any cleanup must be done manually from the Hierarchy. Save your scene after generating or baking to preserve your work. For full details on object lifecycle, baking, and container management, see the documentation in the TerrainPrefabPlacer/ directory.


Requirements home

RequirementTerrain Height SpheresTerrain Prefab Placer
Unity version2020.3 LTS or later2020.3 LTS or later
Render pipelineURP required (sphere materials use Universal Render Pipeline/Lit)Any (URP, HDRP, Built-in) — no materials created
DependenciesNone — built-in Unity APIs onlyNone — built-in Unity APIs only
Scene requirementAt least one active Terrain in the sceneAt least one active Terrain and one prefab slot filled
PlatformAll Editor platforms (Windows, macOS, Linux)All Editor platforms (Windows, macOS, Linux)
Runtime useEditor-only. Not available in builds.Editor-only. Not available in builds.

Installation home

  1. After purchasing on the Unity Asset Store, click Open in Unity on the store page. This opens the Package Manager and navigates to My Assets with the package selected.
  2. Click Download, then Import once the download finishes.
  3. In the Import Unity Package dialog, all contents are pre-selected. Click Import.
  4. Allow Unity to compile the newly imported scripts.

After import, the following structure will be present in your project:

Assets/BBB/TerrainHeightVisualizerAndPrefabPlacer/
├── TerrainHeightSpheres/
│   ├── Editor/
│   │   └── TerrainHeightSpheres.cs
│   ├── TerrainHeightSpheres.html
│   ├── README.md
│   └── ImportantNoteAboutSupport.html
└── TerrainPrefabPlacer/
    ├── Editor/
    │   └── TerrainPrefabPlacer.cs
    ├── TerrainPrefabPlacer.html
    ├── README.md
    └── ImportantNoteAboutSupport.html

No additional setup is required. Both tool windows are immediately available under Tools > BBB in the Unity menu bar.

Importing one tool independently: Both tools are self-contained. If you only want one, you can uncheck the other’s subfolder in the Import dialog. They have no shared code dependencies.


FAQ home

Q: Do I need both tools, or can I import just one?

A: Each tool is fully self-contained and works independently. You can uncheck either tool's subfolder in the Import Unity Package dialog to import only the one you need. The tools have no shared code and no dependency on each other.

Q: Why does Height Spheres require URP but Prefab Placer does not?

A: Terrain Height Spheres creates sphere GameObjects and assigns dynamically generated materials using the Universal Render Pipeline/Lit shader to display the elevation gradient. The shader must be present in the project for colors to display correctly. Terrain Prefab Placer instantiates your own prefabs and applies no materials of its own, so it is render-pipeline agnostic.

Q: Can I use the same percentile values in both tools to target the same terrain area?

A: Yes — this is exactly the intended workflow. Both tools compute their elevation thresholds against the same global height range. A bottom percentile of 60 and top percentile of 80 will resolve to the same absolute height band in both tools, as long as the terrains in the scene have not changed between generation passes.

Q: Height Spheres disappeared when I entered Play Mode. Is that a bug?

A: No. The visualization spheres are created with HideFlags.DontSave by design, which prevents them from being written to the scene file or persisting across Play Mode transitions. They are a read-only analysis tool. Re-generate after exiting Play Mode if needed.

Q: The prefabs placed by Terrain Prefab Placer disappeared after I closed Unity.

A: Generated prefab objects are standard scene GameObjects. Save the scene after generating (or after baking) to persist them. If you did not save, the objects were lost with the unsaved scene state.

Q: Where is the detailed API reference and usage guide for each tool?

A: Full documentation for each tool — including all settings, methods, constants, tips, and troubleshooting — is in the tool’s own subdirectory. See the TerrainHeightSpheres/ and TerrainPrefabPlacer/ directories for their respective HTML documentation and README files.


Version History home

v1.0.0 — Initial Release


Support and Contact home

For questions, bug reports, or feature requests, please contact us through the Discord channel linked below.

Publisher: BigBuffaloBill

Discord: BigBuffaloBill & Friends Gaming + (bbb-unity-support-forum-public)