- Home /
Question by
jasoncosma · Jun 25, 2012 at 09:36 PM ·
playertimetimescale
Slow down everything besides Player?
Is there a way to use Time.timeScale to slow down everything, but the player would still move in realtime? Or is there a different way to do this without Time.timeScale?
Thanks guys, I appreciate any help
Comment
Answer by whydoidoit · Jun 25, 2012 at 09:39 PM
In your players update function do this:
function Update() {
var myDeltaTime = Time.timeScale == 0 ? 0 : Time.deltaTime / Time.timeScale;
}
then use myDeltaTime for all of your speed based operations. That is probably not going to work with physics though - there you would have to do all sorts of playing with velocities...
Or you could just set the speed of your character = to itself /Time.timeScale;