Hello EveryOne ...
So i'm making a 2D Game in Unity Using C# ... i have a Game Object .. where i make a lot of clones from it ... when one of these Clones including the Original One go Invisible .. i destroy it ..
The problem is that when i Destroy the original gameobject all the others get destroyed .. and i can't spawn anymore :/
here is the spawner ;
public void spawner()
{
i++;
bars.Add( (GameObject)Instantiate(blocks, transform.position, Quaternion.identity));
Debug.Log("Spawned"+i);
}
and the destroyer :
void OnBecameInvisible()
{
Destroy(this);
}
Thanx
↧