I am adding 'slow motion' to my game using Time.timeScale. It's working great, but I'm now trying to figure out how I can exempt my player so that everything EXCEPT the player runs in slow motion.
Can anyone suggest how I might achieve this? I'm thinking that it's probably going to be quite difficult.
Ah old post but for anyone else I’d say you need to re-factor the physics for the player.
If player movement is controlled by applying forces then you could reduce the mass of the player upon slowing down time.
This way the same amount of force applied to the player object will give the same change in APPARENT velocity.
So you want to know how much the object needs to weigh to make the object travel (1/Timestep) times as fast per unity of added kinetic energy.
To figure out exactly how much to make the mass rearrange Newton’s equation for kinetic energy (Kinetic energy - Wikipedia):
Ke = (1/2) * Mass * Velocity * Velocity
→ Mass = 2 * Ke / (Velocity * Velocity)
From 1) Say that Velocity = 1, Mass = 2. Therefore Ke = 1
We want Velocity to equal 2 so from 2) say that Ke = 1, Velocity = 2. Therefore mass = 1/2.
Halve the mass and physically your object will act as if Timestep is doubled. Just plug a different Velocity into 2) to get different masses. (remember that velocity should be 1/Timestep ie. game time per unit real time).