Scripting API

Terrain

class in UnityEngine · UnityEngine.TerrainModule · inherits from Behaviour

18 of 67 of Unity's membersUnity's documentation
In Tassix

A terrain. Its data's heights are kept and sampled, but terrains aren't drawn or collided with yet; adding one says so once.

Constructors 1

Properties 11

static Terrain? activeTerrain { get; }

The first enabled terrain.

static Terrain[] activeTerrains { get; }

The enabled terrains.

float basemapDistance { get; set; }
float detailObjectDensity { get; set; }
float detailObjectDistance { get; set; }
bool drawHeightmap { get; set; }
bool drawTreesAndFoliage { get; set; }
float heightmapPixelError { get; set; }
Material? materialTemplate { get; set; }
TerrainData? terrainData { get; set; }
float treeDistance { get; set; }

Methods 6

static GameObject CreateTerrainGameObject(TerrainData assignTerrain)

A "Terrain" object with a terrain and its collider, both on the data.

void Flush()
static void GetActiveTerrains(List<Terrain> terrainList)
Vector3 GetPosition()
float SampleHeight(Vector3 worldPosition)

The surface's height under a world position (clamped to the terrain), above the terrain's own height.

void SetNeighbors(Terrain? left, Terrain? top, Terrain? right, Terrain? bottom)

Not in Tassix yet 49

AddTreeInstance GetClosestReflectionProbes GetKeepUnusedCameraRenderingResources GetSplatMaterialPropertyBlock SetConnectivityDirty SetKeepUnusedCameraRenderingResources SetSplatMaterialPropertyBlock allowAutoConnect bakeLightProbesForTrees bottomNeighbor collectDetailPatches compressedHolesFormat compressedHolesTextureFormat deringLightProbesForTrees drawInstanced editorRenderFlags enableHeightmapLODFrustumCulling enableHeightmapRayTracing groupingID heightmapFormat heightmapMaximumLOD heightmapMinimumLODSimplification heightmapRenderTextureFormat heightmapTextureFormat holesFormat holesRenderTextureFormat ignoreQualitySettings keepUnusedRenderingResources leftNeighbor lightmapIndex lightmapScaleOffset normalmapFormat normalmapRenderTextureFormat normalmapTexture normalmapTextureFormat patchBoundsMultiplier preserveTreePrototypeLayers realtimeLightmapIndex realtimeLightmapScaleOffset reflectionProbeUsage renderingLayerMask rightNeighbor shadowCastingMode topNeighbor treeBillboardDistance treeCrossFadeLength treeLODBiasMultiplier treeMaximumFullLODCount treeMotionVectorModeOverride

Checked against Unity

Conformance scenarios that exercise it, recorded in Unity and compared event by event.