Quantcast
Channel: Latest Questions by Monko
Viewing all articles
Browse latest Browse all 34

Changing a variable in another script for one object.

$
0
0
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

Viewing all articles
Browse latest Browse all 34

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>