- Home /
The question is answered, right answer was accepted
Scripts Disappearing / Not Working... Randomly
Quite strange.
What happens is whenever I touch anything in monodev, from adding a Debug.Log, a new variable, or anything else in ANY other script, my main character loses a script, and I get hit with like 10 errors.
When I check all of the scripts that my character is supposed to have, they are all there, including the one that error is coming from. Basically to recap, I can't GetComponent a script that's directly attached to my character because Unity is saying that it's not. If I don't edit anything in Monodev, though, it's fine and works perfectly.
If I don't touch anything, I can run the game 100s of times and get no errors. The second I change any value to anything, it errors out.
Anyone have any ideas?
are you using notification center to connect link between script or i can say are u connecting script with each other .. dependent script things like that
Actually I found out the reason, but it's strange as hell.
Every time I compiled my script I think I took off Clear On Play in the console by accident. I kept getting null refs when I restarted unity from the previous session without saving, but those were from a starting compile. It was like unity saved the errors and the code, but never corrected itself of the errors even after the script updated.
After restarting unity 10+ times and clicking "Clear On Play" twice, it eventually stuck.