title: Object destroys and doesnt play particle system
body: <p>I'm new to scripting in unity and I have a script that destroys an object when its health reaches <code>0</code></p>
  
  <pre><code>var EnemyHealth : int = 10;
  
  function DeductPoints (DamageAmount : int) {
      EnemyHealth -= DamageAmount;
  }
  
  function Update () {
  
      if (EnemyHealth &lt;= 0) {
          GetComponent.&lt;ParticleSystem&gt;().Play();
          Destroy(gameObject);
      }
  }
  </code></pre>
  
  <p>When I run this script it works fine but when it gets destroyed, it doesn't play the animation and continues with destroying it.</p>