- Home /
checking a global var
ok I'm trying to set up a global var canshoot that says when its true allow to shoot when its false don't allow to shoot so how do I declair a global var and then how do I check a var
Comment
Answer by tertle · Jan 31, 2011 at 04:01 AM
c#
public class example : MonoBehaviour {
public static int someGlobal = 5;
}
Reference by someGlobal from within script or by example.someGlobal from outside.
javascript
static var someGlobal = 5;
Reference by someGlobal from within script or TheScriptName.someGlobal from outside.