hi all!
I’ve noticed that using the terrain and the trees placement with the random tree rotation the trees are placed all with no rotation…
the strange thing is that I do this script:
GameObject go = Selection.activeGameObject;
var terrain = go.GetComponent<Terrain>();
for (int i = 0; i < terrain.terrainData.treeInstances.Length; i++)
{
Debug.Log("Rotation: " + terrain.terrainData.treeInstances[i].rotation.ToString());
terrain.terrainData.treeInstances[i].rotation = 0.0f;
Debug.Log("New Rotation: " + terrain.terrainData.treeInstances[i].rotation.ToString());
}
the log tell me that the rotation is effectively randomized, but the 3d is still not rotated…
the line where is set the rotation to zero doesn’t work
thanks!