title: Alternatives to Destroy() or SetActive()
body: <p>I have a problem with my script. I'm really looking for a solution without having to post code. ( I'm using Unity 2019 with C#. )</p>
  
  <p>Here's the dilemma:</p>
  
  <p>I have two scripts
  1) EnemyDamage
  2) EnemySpawn</p>
  
  <p>Both scripts work fine until one of the enemies is killed. </p>
  
  <p>Basically when my enemy('s) die I use Destroy(gameObject) which ultimately is causing the error on my spawn script because the EnemySpawn is still trying to access the destroyed enemy. </p>
  
  <p>The way my spawn script works is multiple enemies can be chosen from a list. Then using coroutines, the enemies appear on screen and then disappear using SetActive(true/false). So even if I elect to set the enemy to false in EnemyDamage, the EnemySpawn will just set it back to true.</p>
  
  <p>So what I need is another way to hide my enemy. ( And I can't just move it out of camera sight because the EnemySpawn will just put it back on a random spawn point in camera view again )</p>
  
  <p>What are some alternatives to Destroy(), SetActive(), or moving out of camera range?</p>