Is there any way to change a tree’s seed property in script?
There is tree.data that maybe of help, although the docs are very sparse. I would suggest Debug.Log() to see what you have available to work with.
Here is a forum thread that is similar to your question:
http://forum.unity3d.com/threads/186078-Placing-unique-trees
I didn’t find any solution. I want to use tree model alone, not in terrain tool.
I was attempting to do this.
I can change the seed, but it doesn’t update at runtime. Running out of time
So here is as far as I got.
void Start ()
{
var baseTree = GetComponent<Tree>();
_treeController = baseTree.data as TreeEditor.TreeData;
_root = _treeController.root as TreeEditor.TreeGroupRoot;
_root.seed = Random.Range(0, 9999999);
_root.UpdateSeed();
}
You’ll see the editor change the seed, but nothing happens.
1 Like