Hi I made clones of a ghost around my map and they flicker over time but I want it so after 11-15 flickers that the ghost will disappear and it randomly picks a clone and enables that instead
GameObject ScaryFemale = GameObject.Find("ScaryFemale");
GameObject ScaryFemale1 = GameObject.Find("ScaryFemale1");
GameObject ScaryFemale2 = GameObject.Find("ScaryFemale2");
}
while (ScareSel <= 1){
if(invisloop <= 11) {
Debug.Log (invisloop);
if (gameObject.renderer.enabled) {
curTime = Random.Range(0.01f, maxTimeInvis);
} else {
curTime = Random.Range(0.01f, maxTimeVis);
invisloop++;
}
gameObject.renderer.enabled = !gameObject.renderer.enabled;
yield return new WaitForSeconds(curTime);
}
There are 3 objects so how do I get the GameObject “ScaryFemale” in this code instead of the gameObject.renderer.enabled?
I had this working as 4 scripts by placing 3 on the character and having 1 control which script was running but it really wasn’t that feasible