I’m having the same problem. I can generate a scripted terrain at a heightmapScale of (1, 200, 1), but with terrain at size 4096 the heightmapResolution must be 4097. Then I can manually lower the heightmapResolution in the editor to say, 257 which then works fine after applying the “resizing” button in the Unity Terrain editor. Then I see (via script) that the heightmapScale has been reset by the editor’s resizing to the value (16, 200, 16). This all makes sense since 16*256 + 1 = 4096 + 1.
However, my problem is that I have to do this manually for all of my terrain tiles. Why can’t Unity support the editor’s resizing button with a scripting function? Or simply provide a scripting function to map lower resolution heightmaps onto terrains? Is some way to do this?
Using the code kenncann linked above I hacked together a solution. But I don’t really understand it, and I had to remove a bunch of stuff from the code I also didn’t understand.