- Home /
Making each tree unique?
I am using the Tree Creator to make trees, with great success. (In the creation)
I want to use them individually, I am not trying to integrate them with the terrain system.
The Prefab that is created isn't quite like other Prefabs... If you spawn a copy of the prefab, then change the Seed on the tree (to make it another randomized version of the settings) it changes the Seed value in not only the active tree, but any other trees that are copies, and also on the tree Prefab.
Is this related to the ID of the tree? If I want to have multiple procedural versions of the same tree, do I have to create them ahead of time in the editor?
Answer by Justin Warner · Dec 07, 2011 at 03:24 AM
Try making the seed, putting it in its own prefab, then use that prefab as a separate game object as any other. So if you want 10 different types of trees, you'd have 10 different prefabs, each holding a separate tree.
Does that make sense? Lol.
Basically, if you put multiple prefabs out in a field, then you change the root prefab, well, all the children of that prefab are going to change too because they want to be like the root. So if you make different prefabs, it'll be the same way... Lol.
Maybe this won't work though, and if not, sorry =P.
Not ideal, but O$$anonymous$$ if I can't control it directly.
Any other ideas, anyone?
In all honesty, if you have 10 prefabs, and put a script that randomly rotates them and scales them slightly, no one is going to notice similiarities... Bad example, but CoD2 had about 5 trees per-a-terrain type... So 5 snow, 5 bush, 5 dessert, etc. But that's just my opinion =).
I'd really love to find a way to make each one unique, some way to script uniqueness on the fly, but if nobody else comes up with an idea, I'll flag you as the answerer... ;)
Answer by P_Hansson · Jul 04, 2012 at 06:09 PM
Seems to be linked in order to prevent the generation of an excessive number of models. Would be cool with individual trees, but as long as you have a couple players won't notice.
Answer by michidk · Sep 23, 2016 at 09:09 PM
We made a editor plugin, which creates new randomized versions of a tree. Input: A tree you made with the Unity tree system. Output: Any number (you can set it) of trees.
Get it here: https://www.assetstore.unity3d.com/#!/content/59228
Does this work for procedural generation of unique trees at runtime?
No, its just a hack to automate the process of randomize the seed from tree assets. You also could do it by hand, buts it takes ages to do it with a lot of trees. And no, since it works with tree assets (that must be saved in the project) it can't be used at runtime.
But I guess it would be possible to use the code that modifies the seed, to change the seed of instantiated trees in the scene.
"I guess it would be possible to use the code that modifies the seed, to change the seed of instantiated trees in the scene" - yeah, I've always guessed that too. Never been able to make it happen though! Never $$anonymous$$d...
Your answer
Follow this Question
Related Questions
Tree creator , palm trees 0 Answers
Tree Creator Problems 1 Answer
Accessing Unity tree creator through C# 0 Answers
Tree Creator throws NRE over trying to move the root node of branches, stuck in their positions. 1 Answer
LWRP and Trees 0 Answers