What im precisely trying to do is to spawn a few objects in random within the margins of the x, and z of the terrain size.
So Im using :
public static Terrain activeTerrain;
To store the activeterrain to a terrain
And :
Vector3 Dsize = activeTerrain.terrainData.size;
This gives a “nullPointerExcepcion” error .
Can someone give me an example to how to get the current active terrain or at least one terrain and how to get the size of it? Or is there any other way to set an object to be spawn within the limits of the terrain?
Thanks
