title: Unity - How to respawn a Gameobject after destroy
body: <p>I'm Using unity for developing my game. I've created a simple game just like football after scoring a goal the ball should be destroyed and then reappear at its original place.</p>
  
  <p>I've attached this script to my goal object.</p>
  
  <pre><code>public GameObject ball;
  Vector3 ballPosition = new Vector3 (4.51f,0.10f,-3.78f);
  
  void OnTriggerEnter(Collider other)  
      {
  
          StartCoroutine ("RespwanBall");
  
      }
  
  IEnumerator RespwanBall() {
  
      GameObject clone = (GameObject)Instantiate (ball, ballPosition, Quaternion.identity) as GameObject;
  
      Destroy (ball.gameObject);
  
      yield return null;
  
  }
  </code></pre>
  
  <p>But it works only for the first time. and then After second destroy it gives an error saying that the object is already deleted and you are trying to access a deleted object or something like that. And if I use the destroy function in the <code>OntriggerEnter</code> function it gives the same error during the first collision.</p>
  
  <p>How can I do it? Please Help.</p>
  
  <p>ThankYou.</p>