I'm having problems with terrain scripting while trying to do a infinite-world with Unity's terrain generation.

How do I change the terrain height at specific points? And how do I set the amount of terrain generated?

Edit: What I'm having problem with is doing that from a script, from the editor is plain easy.

  • \$\begingroup\$ I was also looking for a tutorial to what docs.unity3d.com/Documentation/ScriptReference/TerrainData.html means. You've edited my answer maybe a bit too much. Now If someone knows that, I won't get that answer. \$\endgroup\$
    – Iridium616
    Commented Feb 1, 2014 at 16:48
  • \$\begingroup\$ I removed that because asking for tutorials is not the purpose of this site. Instead of asking for a tutorial, ask about the problems you think a tutorial will solve for you. \$\endgroup\$
    – House
    Commented Feb 1, 2014 at 16:50
  • \$\begingroup\$ What have tried already? I created a terrain object and found it simple to change the size, and using the tools it's simple to change the height values. Maybe you can explain more about what you're having trouble with. \$\endgroup\$
    – House
    Commented Feb 1, 2014 at 16:55
  • \$\begingroup\$ "Using the tools" I'm trying to do it from a script. I'm having trouble with understanding the obscure functions. \$\endgroup\$
    – Iridium616
    Commented Feb 1, 2014 at 16:59
  • 1
    \$\begingroup\$ @Iridium616 Please provide the answer in the answers section. \$\endgroup\$
    – concept3d
    Commented Feb 1, 2014 at 18:01

1 Answer 1


Nevermind. After an hour of trying I have found the method.

Well, it's actually a variable, and it's a Vector3 called "size", who could have guessed it?

I still can't believe I've missed it for that long.

For heights, still as obvious, "SetHeights method";

  • \$\begingroup\$ This doesn't address the changing specific height values portion of the question. \$\endgroup\$
    – House
    Commented Feb 3, 2014 at 14:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .