ワールド空間で定義された位置の高さ、相対的な地形の空間をサンプリングします
function LateUpdate () { transform.position.y = Terrain.activeTerrain.SampleHeight(transform.position); }
using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { void LateUpdate() { transform.position.y = Terrain.activeTerrain.SampleHeight(transform.position); } }
import UnityEngine import System.Collections public class ExampleClass(MonoBehaviour): def LateUpdate() as void: transform.position.y = Terrain.activeTerrain.SampleHeight(transform.position)