- Home /
Combine GameObjects into one prefab via code at runtime
Hi all,
I am currently coding a game where you can create an army of units that are customisable (i.e you can choose arms, legs etc).
What I would like to do is to create a prefab (or instantiate a premade prefab) via c# code at runtime and add the 3d models into it to form a complete body. I have looked at the related questions to my plite but I can't seem to find a plausible answer...
Any help or points in the right direction would be greatly appreciated.
Thank you for your time, Andrew
Have you looked at the character customization tutorial? It would probably be far easier to do what you want by saving a textual representation of the "saved" units, parsing that and generating instances of them at run-time (and stitching the meshes together) than saving prefabs.
Thanks burnumd, I didn't realize that demo was available for download. $$anonymous$$y answer will propably be there.
Thanks again