- Home /
Question by
bodzio1809 · Jan 18, 2015 at 10:15 PM ·
gameobject.find
Switching between two scripts on childreens(3d models) of one ImageTarget(vuforia) in one button problem with GameObject.FindGameObjectsWithTag
I am using this code and I don't have idea why it's not switching scripts:
public GameObject[] x;
void Start() {
if (x == null)
x = GameObject.FindGameObjectsWithTag ("z");
}
and code in onGUI button
foreach (GameObject y in x) {
y.GetComponent(sc1).enabled = false;
y.GetComponent(sc2).enabled = true;
}
Comment