- Home /
cleanup variables on editor BUG?
Hi,
I am having problem when developing because still some variables are not refresed though I change the values on the script. Even, I delete the script from the gameobject and I drag-and-drop again, but this doesn't do anything.
In this ocassion I am trying to load a file from a location in my disk, since I was having problems I decided to move the file and of course the location it should be taken in my script, but still it tries to find it in the previous location, which it does not exist anymore in my script. I even close Unity several times, but nothing.
Any suggestion? how to clean up the "cookies" of the editor? Even restarting the computer doesn't help.
Thanks
Answer by Mike 3 · Mar 29, 2011 at 01:15 PM
Start using private variables
Unity serializes public variables by default, which makes it easy to change them from the inspector, but it does trip people up when they don't realize it
Alternatively, the reset button (right click the component in the gui and click reset) should set everything to script defaults
Note - this is not a bug, it's a fairly well documented feature
Thank you very much, but this doesn't work.
It got solved by itself (after more than 30 $$anonymous$$) but it can appear again whenever it wants :S
Sure you're changing the right thing to private? (Have to check sorry - never seen a bug do anything similar)
It might be better to use internal rather than private. That way you can use them from other scripts if you need to.
If it were me, I'd use private and use a public accessor function ins$$anonymous$$d for that case
Yes, $$anonymous$$ike in his last coment were right, that's the way it should be