I am making a 2D game where enemy spawn from the sky using an enemy spawner using a prefab as the game object, I wanted the enemy to die when it gets hit by a bullet from the player but it says tat destroying assets is not permitted due to data loss, and I also tried putting in a variable and then destroying the variable but it did nothing(maybe i was doing it wrong). Is there another way i can destroy the instance.
Here is the code for spawning the enemy:
Here is the code for destroying it:
Thank you!