title: unity3d Space Shooter life system collision not working
body: <p>As I am new to Unity3D and started with Space Shooter tutorial. Now I am unable to create a simple life system for the space ship, probably, it's a silly mistake but I've been on it for few hours already, searching for the solution. </p>
  
  <p>The OnTriggerEnter code is:  </p>
  
  <pre><code>void OnTriggerEnter (Collider other)
  {
      if (other.CompareTag ("Boundary") || other.CompareTag ("Enemy"))
      {
          return;   
      } 
  
      if (explosion != null) //hit object explosion
      {
          Instantiate (explosion, transform.position, transform.rotation);
      } 
      if (other.tag == "Player" &amp;&amp; playerHealth &gt;= 1) {
          playerHealth--;
          gameController.SubLive (playerHealth);
      }
  
      if (other.tag == "Player" &amp;&amp; playerHealth &lt;= 0) {
          Instantiate (playerExplosion, other.transform.position, other.transform.rotation);
          Destroy (other.gameObject);
          gameController.GameOver ();
      } 
      Destroy (gameObject); //destroy hit object
      gameController.AddScore (scoreValue);
      /**/ 
  }
  </code></pre>
  
  <p>I've found that the solution is to decrement player health every time collision happens, however, it does only work the first time once player ship collides with asteroid or enemy ship. The triggers are player ship, enemy ship and bolts (shot from ships). All of the objects has rigidbody. Could you please suggest what am I doing wrong?
  Thanks in advance!</p>
  
  <p>You can find non-edited Space Shooter script <a href="https://unity3d.com/learn/tutorials/projects/space-shooter-tutorial/extending-space-shooter-enemies-more-hazards?playlist=17147" rel="nofollow noreferrer">Here</a></p>