TerrainData Manual     Reference     Scripting  
Scripting > Runtime Classes > TerrainData
TerrainData Class, inherits from Object

The TerrainData class stores heightmaps, detail mesh positions, tree instances, and terrain texture alpha maps.

The Terrain component links to the terrain data and renders it.

Variables
heightmapWidth

Width of the terrain in samples (Read Only).

heightmapHeight

Height of the terrain in samples (Read Only).

size

The total size in world units of the terrain

Functions
GetHeights

Get an array of heightmap samples..

SetHeights

Set an array of heightmap samples.

GetInterpolatedNormal

Get an interpolated normal at a given location.

Inherited members
Inherited Variables
name

The name of the object.

hideFlags

Should the object be hidden, saved with the scene or modifyable by the user?

Inherited Functions
GetInstanceID

Returns the instance id of the object.

Inherited Class Functions
operator bool

Does the object exist?

Instantiate

Clones the object original and returns the clone.

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. It is strongly recommended to use Destroy instead.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

FindObjectOfType

Returns the first active loaded object of Type type.

operator ==

Compares if two objects refer to the same

operator !=

Compares if two objects refer to a different object

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new scene.