title: Delay in C#/Unity
body: <p>I want to do a delay in Unity, because the Object should not get destroyed immediately.<br>
  Note: <code>yield WaitForSeconds (0.25);</code> doesn't work for me. It gives many errors like</p>
  <blockquote>
  <p>; expected</p>
  </blockquote>
  <p>even if I have one.</p>
  <p>Here is the Source code:</p>
  <pre><code>using System.Collections.Generic;
  using UnityEngine;
  
  public class DestroyObject : MonoBehaviour
  {
       void OnCollisionEnter(Collision other)
       {
           if (other.gameObject.tag == &quot;Enemy&quot;)
           {
              //Here 2 Seconds Delay
              Destroy(gameObject);
           }
       }
  
  }
  </code></pre>