Hi all!
Here is a half-working script for “slowmotion” inside an animation.
So I’m writing for 2 reason, As I was Google:ing this function I never found what I was looking for so I think this could be helpful to other beginners, so in case someone is looking for this function in the future, this might work… and - I’m also asking for help to make it work even better.
How it works:
Im using this effect when My player make a PowerJump move. He jumps up in the air, flip and stomp down.
It looks cool but it looks even better if its a slight slowmotion effect when he does the Air Flip. This script slow down the whole game while he is doing the back flip. All you have to do is add these flags to the Animation Timeline, select the slowMotionEffectStart and slowMotionEffectExit and its all good…
Attach these simple lines inside any script that is attached to your player:
void slowMotionEffectStart()
{
Time.timeScale = 0.5f;
Time.fixedDeltaTime = 0.02f * Time.timeScale; //SlowmotionEffect
}
void slowMotionEffectExit()
{
Time.timeScale = 1f;
Time.fixedDeltaTime = 0.02f * Time.timeScale; //SlowmotionEffect
}
Is there a better way to add a slowmotion effect inside an Animation?
Is it possible to ONLY slow down the player, not the entire game?
Other then that, this function is great for Picky creators who want to slow down time in certain areas inside the animation
cheers!