- Home /
how do i stop instantiate from changing a prefab
hehehe so this is a odd bug from what i understand instantiating prefabs should not change prefabs but it is sort of
so i have a prefab object with a list of prefab objects this list includes its own prefab (so yes it can spawn itself)
now when it spawns, its creations contain many variables and additional objects not assigned in the prefab (but are assigned/generated during runtime)
and this error replicates by generation
if I've seen spawned objects having clones of clones of clones (clone)(clone)(clone)
anyone know anything about this issue
What version of Unity? And where are you instantiating it (Awake, Start, Update, on PostProcess$$anonymous$$odel, etc)?
the latest v3 pro
instantiation is happening in both an awake and a very heavy coroutine
the coroutine instantiates the main prefab while the awake is instantiating a sub object that is getting replicated by the coroutines instantiation
I should probably add that its not necessarily changing a prefab but somehow the reference to the prefab is changing, even though I never change it (reference = something never happens)
update: so i did a fix that hate with passion basically I put an if at the top of an awake that asks if the name is ... clone clone if it is i destroy it immediatly, which ofc throws lots of errors but is unfortunately all i can do because if i let it finish it will cause problems.
FYI still not answered
Your answer
![](https://koobas.hobune.stream/wayback/20220613085115im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Object spawns itself instead of it's prefab. 3 Answers
Prefab, procedural attachment of child, childCount return 0 1 Answer
Instantiate with Prefabs 2 Answers
How to attach a Script/GameObject in the Scene view to a Prefab in the Assets folder. 1 Answer
How to instantiate multiple clones of the same prefab ? 1 Answer