- Home /
Slowing time to key prompt
I am a beginner with Unity 3D with minimal experience. I have a game concept and I am trying to figure out the ways to make my ideas work.
What I will be doing:
In this situation I would to have the player character run towards a railing in order to vault over it. A particular key being pressed will result in vaulting the railing. When the player character reaches a certain close distance from the railing I want time to slow (maybe even a noise or something as indication) for a second or so for the user to hit the button corresponding with the vaulting action.
What I would like to know: How, if not to much of a hassle, would one get "time to slow down" for the button prompting and return to normal speed and lead into the resulting animation for the vaulting of the railing?
Answer by by0log1c · Mar 07, 2011 at 05:41 PM
If you want the whole game time to slow down, set Time.timeScale to whatever speed you like(0-99.99). Default is 1.
If you just want, let's say, the character to slow down, you'll have to make your own speedFactor= ~1; variable then multiply any time-related movement by your private speedFactor.
Thank you for the fast response. I figured it was simple, but I want to know what I am getting into with this project idea. Are their any issues with slowing down the game like that? Do you think character slowing for the situation described would be more effective personally, or would whole game temporary slow down be better?
It all depends on the effect you want to obtain. If you want to make a bullet-time a la $$anonymous$$atrix for a temporary moment then Time.timeScale is the way to go. I use it every now and then and never had any problem yet. AFAI$$anonymous$$, both are viable. Private speedFactor allow for more possibilities but are more hassle to set and regulate.
Thank you very much. You gave me great insight into how to handle my project idea. Being so new I need points to look into in the formation of my game.