I am trying to replicate a chaos control effect in unity for a 2D platformer game similar to Sonic x SHadow Generations. Shadow is able to freeze the objects around him, while also freezing the actually time it is taking for you to complete the level. I understand time.deltaTime = .2 can slow down time but how would I make it where while everything is frozen the player cans still move at normal speed?
You would need to ensure the player and other relevant options are operating on unscaled time. So for movement code you will be using Time.unscaledDeltaTime
for example, and components like the Animator I believe have options to update it on unscaled time rather than fixed or regular delta time.
so like rn once the c key is pressed itll slowdown , basically Time.timeScale = .1f; qould I just say time.unscaledDeltaTime = 1? or should I put that in my player script when that slow mo method is called?
Not quite what I mean.
Normally when write code to be frame independant you use someValue * Time.deltaTime
for example. To prevent time scale from modifying this, you would be multiplying by Time.unscaledDeltaTime
instead.