- Home /
How slow motion everything except animation
I am a beginner at Unity, but am an intermediate programmer. I understand that timescale = ... will create a slow motion effect, but it seems to slow down the animation too. Is it possible to slow down everything except the animation.
Example: When hit power up it slow mos, then powerup text animation plays, then return to normal speed.
Thanks,
You have to create your own variable to keep track of time, and use that ins$$anonymous$$d of Time.deltaTime for all your methods. This variable can of course be set to any value whenever you want.
Is it possible to get a simple example of this?
It seems that changing update mode to unscaled by time on the animator works, but I'm curious whats the difference between your method and changing the option in animator?
Something like this:
public float t;
public float slow$$anonymous$$otionFactor = 0.2f;
public bool slow$$anonymous$$otion = false;
void Update() {
if(slow$$anonymous$$otion == true) {
t += Time.deltaTime * slow$$anonymous$$otionFactor;
}
else {
t += Time.deltaTime * slow$$anonymous$$otionFactor;
}
}
You would use t for every instance where you would normally use Time.deltaTime, such as Lerp etc.
Answer by RLin · Aug 10, 2015 at 08:21 PM
In your animations, you can divide all of the animation speeds by timescale so that the animation will consistently run at the same real-world speed.