I'm working on a game where an object gets cloned several times until it is clicked. The issue is that the game becomes laggy and has many FPS drops because of the amount of clones. I want to be able to use Destroy(gameObject) to get rid of the clones once clicked. The issue with that however, is the original object cannot get destroyed because then the cloner no longer works.
I've tried several things like comparing tags, layers and such but all the clones have the exact same properties as the original one.
Lag is partly caused by the Garbage Collector freeing up resources after you Destroy the GameObjects.
Usually, to avoid this, you deactivate the GameObject instead of destroying it so that it can be reused for later clones (aka Pooling).
To be able to destroy the original object, you need the clones to be created from something else: usually a Prefab.
So, to sum up, you can create a Prefab of your original object and a Pool to instantiate new clones of it or reuse deactivated ones.
Here there's a simple introduction to pooling with code samples.