well… i unchecked that box in the inspector
and i made a script like this
function Update () {
if (Input.GetButtonDown ("shoot")) {
GameObject.Find("NEWPOINT").active = true;
}
}
but i doest not work… am i doing something wrong?
well… i unchecked that box in the inspector
and i made a script like this
function Update () {
if (Input.GetButtonDown ("shoot")) {
GameObject.Find("NEWPOINT").active = true;
}
}
but i doest not work… am i doing something wrong?
There’s a gotcha with Find that you just hit:
so the gameObject.Find only finds active objects… and thats why is not fidning the NEWPOINT because he is unchecked…
damm…
You can still activate the object, just get a reference to the object a different way (such as assigning it in the inspector).
var target : GameObject;
function Update (){
if (Input.GetButtonDown("Jump")) target.active = true;
}