Ok, I already know how to change the variable in another script. All you do is this:
GameObject.GetComponent(ScriptName).variableName +=1;
But my problem is I have to change the variable TestVariable located in one Gameobject, even though the script is in many gameobjects.
That Probably didn't make sense, so let me explain.
I have hundreds of game objects stored in a 3-dimensional array called "chunks", like this:
static internal var chunks : GameObject[,,] = new GameObject[5,5,5];
for(var z=0;z
↧