We have Terrain.SampleHeight() to get the height at X,Y but do we have something to get the World Space coords at X,Y?

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?

Huh? The X,Y coordinates you supply to Terrain.SampleHeight are world space coordinates already. Combined with the value returned by Terrain.SampleHeight, you have the X,Y,Z tuple of the terrain surface at that point.