This is a really simple question but I cannot find an answer. I want to get a int value from a GUIText object and add a number onto it. There are three scripts all modifying a value so I want to get the current set value of the GUIText and then set the value to a variable. Here is some code...
var GUITextVar : GUIText;
var intvar : int = 0;
var currentval : int;
var equal : int;
function Update(){
intvar+=1;
//Some Code to get the current value of the GUIText
equal=currentval+intvar;
GUITextVar.text=equal;
}
The Code isn't perfect as I just made it up. It would work otherwise.
Thanks
[EDIT]The values being edited from the other scripts are not static [/EDIT]
↧