- Home /
What's the best way to ramp slowmotion?
By ramping I mean progressively slow time down from full speed to full slow motion.
For example, if player hits the slow motion button, after the first hit time is variable (let's say .5x) slower than when she first hit the button. a variable of time later, (let's say 0.1 seconds), it's variable slower (again, let's say .5x) it's current speed until reaching slow motion state desired as set in another variable.
Currently I'm using this function to slow down time, but it's jarring, cause it goes from full speed to ultra slow motion in one jump:
var _slow_motion : boolean = false; var _max_slowmotion : float = 0.03125;
function Slowmotion (){
if (!_slow_motion){ Time.timeScale = _max_slowmotion; _slow_motion=true; }else { Time.timeScale = 1; _slow_motion=false; } }
function Update(){ if (Input.GetButtonDown("Jump")){ Slowmotion(); }
Ramping back up would be nice too, rather than jumping straight back to full speed.
Your answer
![](https://koobas.hobune.stream/wayback/20220613093050im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Calcule Player's Speed based on Time.timeScale 1 Answer
Time.timeScale and Time.fixedDeltaTime 1 Answer
Slow motion all but one - yet another round, hopefully the last 6 Answers
Stabilizing ragdolls in slow motion 0 Answers
How can I add a "delay" before switching back to realtime? (Read description for more detail, sorry) 1 Answer