Terrain.SampleHeight
SampleHeight(worldPosition: Vector3): float;
float SampleHeight(Vector3 worldPosition);
def SampleHeight(worldPosition as Vector3) as float
Description

Samples the height at the given position defined in world space, relative to the terrain space.

	function LateUpdate () {
		transform.position.y = Terrain.activeTerrain.SampleHeight(transform.position);
	}
using UnityEngine;
using System.Collections;

public class Example : MonoBehaviour {
    void LateUpdate() {
        transform.position.y = Terrain.activeTerrain.SampleHeight(transform.position);
    }
}
import UnityEngine
import System.Collections

public class Example(MonoBehaviour):

	def LateUpdate() as void:
		transform.position.y = Terrain.activeTerrain.SampleHeight(transform.position)