- Home /
from which script was it?
im half way down my project and have a lot of scripts to look through. the problem is that a static variable is being changed to false when i dont want it to and i need to find out which script is doing this so i can alter the code...any suggestions?
You could also temporarily change the variable to non static, then it won't be able to be accessed. If something tries to access it, you should get an error for every script that is trying to access the variable.
Answer by Loius · Jul 03, 2013 at 12:16 AM
If you have C#, open monodevelop, right click the variable and 'find references'.
If you have JS, use search/find in files.
I usually just use search/find in files - it's faster than 'find references'.
I grabbed Xamarin Studio a couple weeks ago (new monodevelop), tore out half my hair in frustration at the new clunky interface and occasional bug, and then enjoyed the heck out of it because Find References is super-fast in that version.
Cool! So, you do unity monodevelop updates?! I tried it once and never again.
Answer by iwaldrop · Jul 03, 2013 at 12:14 AM
Search your code for the variable name. Find where it's being set. Change it.
i made a separate script for all static variables. and i change these from other scripts.
Your answer
![](https://koobas.hobune.stream/wayback/20220613105357im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Access a static var from different named scripts? 1 Answer
Static variables 1 Answer
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
variable = true from another script 2 Answers
Public and Static Variables 2 Answers