Disable inspector affects on public variables

Everytime i get this strange error, I realize the value(public) is being affected by inspector value.

For example, let’s say I have DEBUG variable in World.js and happen to set the value as FALSE at Inspector of World.js. In this case, no matter what I assign into DEBUG variable in the script I always get FALSE as result.

Is there way around this problem? How do I disable inspector affecting public variables?

Thanks!

That’s kind of one of the main features of the Unity workflow…you can’t disable it. If you want the values in the script to take precedence, make the variables private.

–Eric

Or tag them with the [HideInInspector] attribute tag.

-Jeremy