Import numeric array as terrain

I’ll get right to it. I built a map generator for my turn-based strategy game that spits out a multidimensional array with numbers denoting geographical features (0=ocean, 1=grass, 2=mountain, etc). What I want to do now is import this array into Unity and turn it into proper terrain. I know I would have to iterate through each number and then probably construct switches to catch each number and create the terrain tile appropriately.

What I don’t know is how to actually create a terrain and manipulate it. I would need to be able to change height and place trees and bodies of water dynamically to match the randomly generated array.

Can anyone point me in the right direction to code this?

Look in the docs for SetHeights. Bodies of water would presumably be a side effect of using SetHeights (i.e., use a water plane that covers the entire area, so anything below a certain height shows the water plane). But the rest of the terrain API is deliberately undocumented I’m afraid.

–Eric