Quantcast
Channel: Questions in topic: "power up"
Viewing all articles
Browse latest Browse all 49

Power Up Script Problem!

$
0
0
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!

Viewing all articles
Browse latest Browse all 49

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>