public class NewBehaviourScript : MonoBehaviour { private Terrain terrain; void Awake() { terrain = gameObject.AddComponent<Terrain>(); } }