I’d like to slow time for a matter of seconds then resume at normal speed. I’m not sure what I should look into to achieve this. I haven’t found any tutorials on the subject. Here’s my (non-working) code:
Update runs every frame, so simply keep track of a timer. During Update(), add Time.deltaTime to your timer. (Or subtract if you’d rather count down.)
I’m not sure whether Time.deltaTime changes speed based on Time.timeScale. If it doesn’t, that’ll be good enough. If it does, then do Time.deltaTime/Time.timeScale.
When your timer reaches the destination, return Time.timeScale to normal.
Thanks for the help. This is what I have so far. It works as a functionUpdate when I start the game, but I need to call the function from another script, so it can’t be functionUpdate (unless it can …I’m a noob, fyi).
There’s an if statement in another script (which is called every frame) essentially stating:
if power > 100
sendmessage(LightSpeed)
power = 0
I’m at work right now, so I can’t test this, but maybe the order is wrong? If i reset power to 0 THEN do the sendmessage, maybe that would work? I’m still stumped til I get home and try.