- Home /
Making Tree Creator Trees Unique
Hi, I have to make several trees with varying levels of health. I have created one and need to make another, but I would like to start with the first as a base. As mentioned in several other threads that ask this question, copying the tree in the hierarchy view will essentially instance it, so any changes to one will be made to the copy.
So, as recommended on those threads and also by a coworker with more Unity experience, I copied the prefab in the Project view using Ctrl+D. However, this doesn't work either. If I bring one of the prefabs in and change a parameter it will change it on the other prefab, even when it's not loaded in the scene. So far the only way I can create a unique tree is to build them all from scratch. Is there a better way to do this?
Thanks, -RL
Try dragging the prefab into the game world or on the game hierarchy. $$anonymous$$odify how you want, make a new prefab and save the modify tree as your new unique tree. This should work hopefully.
Thanks for the reply cdrandin. Tried that and it doesn't work. It still changes the original prefab.
Is it possible I'm missing a '$$anonymous$$ake Unique' flag somewhere?
Still changes the original? It shouldn't. I have made a copy of a prefab onto game world, modified it and made a new one .v2 prefab, which showed the original is the same whereas my new prefab is different. $$anonymous$$aybe there is something unique with terrain properties or something.
Have anyway of upload this model somewhere and I can play with it if you want and give you some input if I come across a solution?
Answer by insominx · Jan 15, 2013 at 10:31 PM
The prefab plan works, but differently than every other object.
When you create a tree, it automatically creates a prefab for it in the root Assets folder. If you duplicate that prefab and drag it into the scene, you can then edit it as a unique tree.
However, this approach does not work if you try create a new prefab yourself using the tree instance in the hierarchy.
In short, don't try creating a prefab of your tree instance; they already exist. You'll know it's different because the Prefab automatically created will have four children in the project view (Tree Data, Optimized Leaf Material, Optimized Bark Material, Mesh). The Prefab you make by dragging will have no children.
Answer by phfatmonkey · Jan 15, 2013 at 10:37 PM
I see, that's weird. It's weird but it works. Thanks, insomnix.