I would like it to create a new Terrain (and set the terrains parameters like position, name, size, resolution etc.).
A bit like clicking on “Terrain” → “Set Resolution” when you are in editor mode except this window would create a new terrain (with preprogrammed parameters and ‘entered’ parameters).
Anyone knows how to use it? It returns a gameObject that I can’t cast on a Terrain, and TerrainData is still read only so how can I set the size of the terrain?
Any help greatly appreciated
ps. Tom, no need to use that kind of tone when someone doesn’t know something you do, right ;-/
Okay, so I figured out how to get the terrain out of the GameObject cough
In the creation of the new terrain (as the TerrainData has variables that are read only) I took the ‘active terrain’ and used that.
But CreateTerrainGameObject() doesn’t create a new terrain, it just makes an ‘instance’ of the active terrain!
So if I modify the created terrain in the editor it also modifies the original terrain…
Anyone knows of a way how to create a ‘new’ terrain?