I am trying to dynamically place game objects into my world (specifically bushes that spawn fruit) and I want to place them based on the detail width/height of my terrain. But I can’t figure out how to get the real world space of those positions.
For example:
int detailWidth = this.terrainData.detailWidth;
int detailHeight = this.terrainData.detailHeight;
int x, y;
for (x = 0; x < detailWidth ; x++) {
for (y = 0; y < detailHeight ; y++) {
//PLACE A BUSH HERE ON TOP OF THE TERRAIN
}
}
How would I do this? Or do I have to do it a completely different way?