Terrain Grid System 2 · Core Concepts
This page covers how to position and configure the grid on your terrain or mesh object for the best visual and performance results.
gridCenter and gridScale.
| Property | Range | Description |
|---|---|---|
gridCenter |
(-0.5, -0.5) to (0.5, 0.5) | Position of the grid center relative to the terrain. (0, 0) = terrain center, (-0.5, 0.5) = top-left corner. |
gridScale |
(0, 0) to (1, 1) | Size of the grid relative to the terrain. (0.1, 0.1) = 10% of terrain size. |
gridCenterWorldSpace |
World position | Sets the grid center using a world-space position. Useful for centering the grid on a character by assigning transform.position. |
See demo scenes 10 and 10b for practical examples of dynamic grid positioning.
The grid is a physically generated mesh that sits on top of the terrain. Precise offset control prevents z-fighting while keeping the grid flush with the surface.
| Property | Description |
|---|---|
| Mesh Pivot | Appears only for custom meshes. Adjusts the local center offset if the mesh origin is not at (0,0,0). |
| Depth Offset | Controls Z-buffer offset for highlight surfaces (Colored Depth Offset) and grid lines (Mesh Depth Offset). |
| Elevation + Elevation Base | Combined Y-axis displacement. Elevation Base uses a numeric field for finer or larger values. |
| Min Elevation Multiplier | Controls the tiny Y-axis offset between the grid root, cell layer, and territory layer (~0.01). Reduce for very large terrain scales. |
| Camera Offset | Dynamically displaces the grid toward the camera. Updates automatically when the camera moves. |
| Normal Offset | Per-vertex displacement along the terrain normal. Makes the grid "wrap" around the terrain. Expensive — only use when needed. |
When attaching TGS to a non-Unity-Terrain object (e.g., a mesh-based terrain), additional filter options appear:
| Option | Description |
|---|---|
| Objects Name Prefix | Filter child objects by name prefix. |
| Objects Layer Mask | Filter objects by layer. |
| Search Global | When enabled, searches the entire scene for matching objects instead of only children. |
Help us improve this documentation page.