How can I change heightmapHeight and heightmapWidth in TerrainData?

Hello,

I’ve developed a terrain generator that works quite well to programmatically generate a heightmap for a terrain game object. However, the heightmap height and width is always 513 for terrain objects that I add via the Unity IDE. If I create a terrain data object in my sciipt, it always seems to be 33x33. If I want my terrain to be 2000ish x 2000ish, I have to create 16 terrain objects and link them together with setNeighbors and assign each terrain’s heightmap the appropriate portion of the 2000ishx2000ish heightmap that my terrain generator has created. I then have to set each terrain objects position properly for everything to line up. This seems like a real kludgy way to go about creating terrain for anything other than 513x513 heightmaps.

I see that I can set the size of the terrainData object with the “size” property, but the heightmapHeight and heightmapWidth properties are read only (only the get method is implemented).

A much better solution for my purposes would be to create one Terrain GameObject with the size that I want so I can assign my generated height map with a single setHeigts call. So, the bottom line is, how do I create a single terrain game object with a heightmap height and width of my choosing? I’m aware that there will be contraints such as the size needing to be a power of 2 plus 1…that’s fine, I just need something other than 513x513 or 33x33.

Thanks!

Kevin

had a little play, it would seem the heightmapWidth and heightmapHeight are derivations of the heightmapResolution, and it always generates a square…

Perfect! Thank you! I’ve been beating my head against the wall with this one.

Kevin