Unity terrain from script : setting heightmap makes terrain to resize (a lot!).

I been working in seting up a unity terrain from script. everything was ok unitl i try setting the heights for the terrain.

As far as i can tell the code looks fine. It makes sence and i get no errors. But still when i run the programm my terrain size get abruptly rescaled. It goes from a size of say 2048 (terrain size) to something like 67000x67000 (i don’t remember exactly) but was a lot. The point is that i don’t alter the size during the execution of the terrain generation script.

Since there are lot of people that allready have done this i was wondering if someone can point out what could cause this to happen?
By the way the heights are not apply either. the new big terrain is flat.

Everything else was working fine so i bet it has something to do with setheights or the procedure involved.

Any thoughts?

SetHeights doesn’t change the size of your terrain. That’s controlled by TerrainData.size.

–Eric

I know that ofcourse. i’m just pointing that for some reason the terrain got resized regardless. And for some reason the setheight command is causing it. Because removing the line everything works again. Obviusly it’s due to bad input data beeing passed as parameters, but i can’t seem to figure out what’s wrong. I just hoped that this has happen to someone else and may point why.

I meet the same situation, it did resize terrain.

I have a similar issue, however my x and z values are just fine. It’s my y value that doesn’t change, but when I set it manually the terrain does what it’s supposed to (being all bumpy and such). Any ideas so far?