Quantcast
Channel: Questions in topic: "clone"
Viewing all articles
Browse latest Browse all 508

Why Original GameObject Destroy Clones ?

$
0
0
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

Viewing all articles
Browse latest Browse all 508


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>