What is the best way to remove an instance of a prefab from the scene/hierarchy?

I’ve been using Destroy() and it’s been corrupting my prefabs.

Also, what exactly is yield used for and how do I use it? I’ve got some code in an OnGui function that I think is executing far more times than it needs to and I’d like to get a reign on it somehow.

Happy Holidays :]

Can I assume no answer means there is no other way? Because I haven’t come across any other method.

yield will wait for one frame then continue. yeild WaitForSeconds(1) will wait for one second

That shouldn’t happen if you use Destroy() correctly (in principle, at least).

If you’re having problems removing game objects from the scene using Destroy(), perhaps you could describe those problems in a little more details. (For starters, what does ‘corrupting my prefabs’ mean? Also, are you calling Destroy() on the prefabs themselves, or on the game objects instantiated from those prefabs?)

I was destroying the instances, and by corrupting I mean the mesh file for the mesh renderer was going missing. Turns out the prefabs need the original mesh file as reference, I had been deleting the imported fbx files once the prefabs were made.

Thanks for your replies and the info on yield :]