Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


TreeInstance

Contains information about a tree placed in the Terrain game object.
Read time 1 minuteLast updated 5 days ago

Definition

  • Type: Struct
  • Namespace: UnityEngine
  • Assembly: UnityEngine.TerrainModule
public struct TreeInstance

Remarks

This struct can be accessed from the TerrainData Object.

Fields

Value

Description

colorColor of this instance.
heightScaleHeight scale of this instance (compared to the prototype's size).
lightmapColorLightmap color calculated for this instance.
positionThe position of the tree in the local space of the terrain. The value is a Vector3 clamped to 0-1, and describes a percentage of the terrain width, length, and height.
prototypeIndexIndex of this instance in the TerrainData.treePrototypes array.
rotationRead-only.
widthScaleWidth scale of this instance (compared to the prototype's size).