- Home /
Question by
AnderielDev · Sep 29, 2015 at 06:06 PM ·
instantiateprefabmaterials
Instantiating one prefab with different materials in one frame
So, in my game i have a tower that can take multiple different materials. What i was using for making them was one prefab where i always swapped the material to the one i wanted and then istantiated it.
When a user is building them i have no problems. Every click makes a different tower. But when i started implementing saving and loading games i suddenly had all towers with the same material.
My guess is that since i instantiate them all in a single frame they take the appearance of the last material used. The only solution that i could find would be making a prefab for every single one of them, which i dont want to do.
Is there any way to force the instantiate to make the object right away instead at the end of the frame?
Comment