- Home /
Prefabs aren't updated when run or built
When I change my prefabs, the prefabs are changed as expected, however when a script uses them, they're not updated. If it's important, my project is for iOS.
I can place them manually and they turn out as expected, but when I have a script place them, it's placing an old version. The error happens when I use either the play button or build the project.
How would I go about fixing this?
RESOLVED
I just created a new prefab from scratch.
If you select your prefab in the project view, does that show the old version in the inspector or the new version?
Did you really 'apply' the changes to the prefab? Or did you maybe modify the prefab in 'Play' mode?
Answer by KhaLa · Oct 01, 2012 at 10:08 AM
Well as far as I've been using (it's not much) I've been using the "reset" button on the window;
Click the game object --> Look for your script component --> Click the little gear icon --> and click "Reset". This will load the default values you assigned from Prefab.
There's also the possibility of the code you've written has compilation problems. After you open your script make sure you clean and build your code manually instead of CTRL + F8 and see that there are no errors.
I've tried the reset thing, and I tried it again. It's still somehow loading an old copy of a prefab. I created a new prefab based on the old one.
I just created a new prefab from scratch and that seems to be working as it should be.
Well it seems it's bugged but it has never occurred to me before. During such cases I just close unity and open it again. %99 of the time it solves the problem. You may try saving the scene next time, since it saves all the prefabs you have modified too.
Your answer
Follow this Question
Related Questions
Instantiate Prefabs. Errors. 2 Answers
Assertion failed on expression: 0 Answers
ThreadCheck error when making Prefabs 1 Answer
What does "Couldn't find matching instance in prefab" mean? 2 Answers