Can I run static var from another script ؟؟؟

Can I run static var from another script ؟؟؟


What do you mean with “run static var”? You can access a static var using the script type (which is the script name, without quotes or extension) followed by .variableName: if the variable health is in the script HealthControl.js, you can access it from any other script as

You can write and read the static var, but “run”… what does it mean?

Hy, yes i think so, I always did it that way (JavaScript):

For expample if I have a script called "PointScript", with the variable

`public static var counter : int = 0;`

If i want to get this variable in an other script you have to write

`private var counter : int;`

`counter = PointScript.counter;`

Dont forget to set it in the update function if the value changes while runtime! Was it that you meant or do I have blamed my selve^^