Hi everyone,
I’m sitting with what must be a pretty simple problem that I just cant seem to figure out.
My code:
function OnGUI () {
SwitchOnObject(characterHead);
}
function SwitchOnObject ( object : GameObject) {
var objectSwitchedOn : boolean = false;
if (!objectSwitchedOn) {
object.SetActiveRecursively(true);
objectSwitchedOn = true;
Debug.Log(object.active);
}
The if condition wont turn off even though I set the boolean to true, any ideas?