Components arent being found in script references
I had recently moved everything on my original character to a new mesh I modeled and at first it was working perfectly and then I added an animator to the character to start animating it then i pressed play and i got a lot of errors saying the references for scripts are not instances of objects. So i went into the scripts and added direct references to the objects separately and they were being found just fine. Then i referenced the scripts from the direct object references and they were still not being found. I have no idea what is interfering with the referencing and i have tried many things to see if i could find them but nothing seems to work. I wonder if it has anything to do with being turned into a prefab but that shouldn't do anything to screw with my references. Please any ideas for what may be causing this?
can you post the code, the error, and the inspector?
But if is a Null reference problem, you must solve it by your own.
Okay for some reason when i closed unity it started to work again so it must have been a stressed session.
Answer by Hsni · Jun 28, 2018 at 12:26 PM
Looks like the references in scripts are missing when you make a prefab. What you need to do is to make prefabs of those references too and pass to the main prefab. They will be available there when you isntantiate it.