Hi there, I’m a total newbie in Unity development and I need help with my current project. I’m currently working on a 2D Platformer which allows the player to slow down time for stronger attacks and puzzle solving.
A game with a similar idea would be Viewtiful Joe. I need scripting suggestions on what to use in order to create the time slow down effect. I would like to assign the slow down power to the shift button. How do I do it?
Factors involved:
1.) Weapons strength upon skill activation
2.) Reverting the physics/attributes back when the SHIFT(slow down) button is released
I highly welcome critics, recommendations, suggestions and things to consider while creating the project. Thanks
To start with, try playing with Time.timeScale, it’s a very easy way to control the rate of time in Unity, and the example even includes a button toggle slowdown effect.
The value of Time.timeScale is the number of seconds that effectively pass in the game for each second of real time. By default, it is set to 1, so game time is the same as real time. However, if you set it to 0.5, then the game will slow to half speed. Conversely, if you set Time.timeScale above 1, the game will run fast. You can set the value anywhere you like in any script. As the doc page says, you should generally also change the value of Time.fixedDeltaTime whenever you change Time.timeScale (ie, set them to the same value). This will ensure that physics and other updates occur at the same rate in real time rather than at the slowed game time rate.
Hmm don’t really fathom but will try it out…
Another thing. I want to make the players be able to hold down SHIFT to activate and release to deactivate the power. How do I get Unity to read the SHIFT key?
Thanks but I already got the Slow power working on SHIFT.
Only thing is I want my character to not slow down along with the scene.
Any idea on how to work on that?