- Home /
Question by
AlienClubrider · Aug 14, 2013 at 05:34 AM ·
do not
How do you delete a clone of a prefab?
I am wanting to get rid of clone prefabs
Comment
as kirillrybin said.
Destroy function.
you can select the gameobjects you want to delete by name, or by tag or whatever you like.
Find whatever you want, there's GameObject.FindWithTag(string tagName), GameObject.Find(string objName), GameObject.FindObjectsOfTypeAll, etc. Then once you find your object(s), just pass it/them to Destroy(...), there's a lot of Finds, just type GameObject.Find... and see what the intellisence gives you back, choose what's best for you. It would be better however if you had an array/list storing what you want to get rid of, that way you could just loop over them, and say Destroy(myThingies[i].gameObject)... without having to find anything.