Hey guys,
Is this even possible? If so any suggestions on were I should start? By terraform I mean, to lower/raise land in real time, edit its texture in real time etc.
Thanks Jacob
Hey guys,
Is this even possible? If so any suggestions on were I should start? By terraform I mean, to lower/raise land in real time, edit its texture in real time etc.
Thanks Jacob
If you’re using Unity’s built in terrains, the heightmap and nearly everything else is adjustable via scripts in realtime.
Yes I am using the built in terrains, How would I edit the heightmap in real time?
A couple of links:
reference to the active terrain:
once you have it…
reference the terrain data of that terrain:
make changes based on the height: (NOTE: all numbers in this set are 0-1, you must do calculation based on the terrainData.size for real world editing)
Make any changes you need also to the splat data: (numbers again based 0-1)
Other supported functions you may find good: (based in real world numbers)
Lastly, we set the terrain data back to the terrain and terraincollider and flush.
There are quite a few more things you can do, but that is the basics