I am making a simple jumping game and I have made a sphere which is going to be my power up. I want it so when I collide with the sphere, it sets the Time.timeScale to 0.5 for only **10 seconds**. Then after the 10 seconds are up, it sets the Time.timeScale back to 1.
This is my current script:
function OnTriggerEnter ()
{
Destroy(gameObject);
Time.timeScale = 0.5;
}
Right now when I collide with it, it destroys the power up and set the Time.timeScale to 0.5, but I can't figure out how to do this for only 10 seconds?
Any help or scripts appreciated!
↧