Hi everyone,
I am getting a duplicate objects when I am creating a terrain with code. The code below is attached to an empty object (MakeTerrain). I am running Unity 2021.3.
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MakeBigBuilding2 : MonoBehaviour
{
Terrain terrain;
// Start is called before the first frame update
void Start()
{
TerrainData _TerrainData = new TerrainData();
_TerrainData.size = new Vector3(600, 5000, 600);
_TerrainData.heightmapResolution = 4096;
_TerrainData.baseMapResolution = 4096;
_TerrainData.SetDetailResolution(1024, 32);
GameObject _Terrain = Terrain.CreateTerrainGameObject(_TerrainData);
}
}
It runs but I get two terrain objects on top of each other.