Destroying an object destroys the reference to it.

I’m making a game in which I need to destroy enemies whenever they come into contact with a certain item. I first referenced the gameobject I wanted to instantiate(enemy) from a script meant to spawn them(enemyUI). I made it so that the enemy spawns every 2 seconds.

The problem I’m faced with is that the original enemy gameobject that I referenced HAS to stay alive to still be able to instantiate more of the enemies. If it doesn’t, it counts as a missing gameobject and therefore can’t be referenced to spawn more.

Anyone know a workaround to this issue?

Anyone? Any input would be appreciated