Freeze time for everything except the player

KO_Games

Member
Hi Justin,

In my game, I wanted to freeze everything in the scene except for the player. I thought that adjusting the timescale to zero for the scene might work and then putting the animator on the player to timeunscaled, but this did not work. Is there a better way to approach this? I saw that you can adjust the timescale on just the player, but I couldn't figure out how to set the timescale to one on the player and 0 for everything else in the scene.

Thanks!
 
Freezing all non-character objects is something you'll have to implement manually. There are a few ways to freeze the movement of an object depending on its components - for example, for a physics object with a Rigidbody you could set the Rigidbody to be kinematic or use Rigidbody.Sleep(). This approach should cover all the objects seen in the demo scene.
 
Top