I have a game object with a script attached called “playerController”. My plan is to destroy this game object from another script and Instantiate it again after 3 seconds via IENumerator. I want the game object to be instantiated with the exact transform values it had during the start of the game.
The following code is from the other script that will destroy the game object with “playerController” attached and re-spawn it after 3 seconds.
public IENumerator Respawn()
{
destroy(playerController.gameObject);
yield return new WaitForSeconds (3.0f);
//This is where I respawn the game object with playerController script attached
}