I am using unity with C# and want to let the player keep moving for a bit after losing, and only then reload the scene. I tried:
{
if (inf.collider.tag == "Obstacle") {
movement.enabled = false;
Camera.enabled = false;
System.Threading.Thread.Sleep(1000);
SceneManager.LoadScene("Level");
}
}
But the problem is that the entire game and physics freeses when it gets to the sleep line. How would I wait to execute SceneManager.LoadScene("Level")
without freezing all proccesses?