- Home /
Question by
Arielgenesis · Jan 08, 2013 at 03:26 PM ·
c#terrainsetheights
Why _terrainData.SetHeights() resizes the terrain?
Terrain incorrect size
If I were to say:
_terrainData.size = new Vector3(_size,_height,_size);
_terrainData.SetHeights(0,0,_heightmap);
My terrain gets very big, around 16 times bigger, only lateral(x and z) direction, not vertically.
I have found my solution, that is to write this instead:
_terrainData.SetHeights(0,0,_heightmap);
_terrainData.size = new Vector3(_size,_height,_size);
Basically to setHeights() first, and then change the .size.
But my questions, why?
extra: At first I didn't know the source of the problem, until after lots of googling, I found http://forum.unity3d.com/threads/155768-Unity-terrain-from-script-setting-heightmap-makes-terrain-to-resize-(a-lot!).
Comment
It does look that way. @Arielgenesis, you should submit a bug report.
Hm, can't reproduce with 3.5.7. $$anonymous$$ight still be a bug that manifests only in certain situations.