Can some one help me out with static variables. I understood them at first and was success in using them. However in a new script I’m developing I’m using a global variable defined in another script in another folder, same language (JavaScript/Unity Script). I’ve been unsuccessful in accessing this variable leading me to receive an error saying “Unknown identifier”
well, let’s say your script is called “ScriptA” and contains this declaration:
static var myGlobalVar : int;
you can access this var from any other script, by saying:
ScriptA.myGlobalVar = 10;
simple as that