0
Unity Bug
Luna 2 months ago • updated by Lazlo Bonin (Lead Developer) 2 months ago 3

Hi, I'm using Chronos, but I noticed that my rigidbodies are not going to sleep at all, all you have to do is implement chronos with any rigidbody and use the physics debugger and see that the rigidbodies that are using Chronos will refuse to go to sleep.

Chronos Version: 2.1
Unity Version: 5.6.1

Answer

Answer
Unity Bug

Hi Luna,

Unfortunately, that's a known issue. Because Chronos has to apply its own custom timescale-dependent gravity, the rigidbody constantly gets awoken.

 In the early versions, I tried manually setting it to sleep by calculating its mass-normalized velocity and comparing it to the physics manager's sleep threshold, but that gave unpredictable results that were inconsistent with Unity's default sleep behaviour. See: https://forum.unity3d.com/threads/how-to-calculate-a-rigidbodys-mass-normalized-energy-for-sleepthreshold.311941/

Until Unity chimes in and tells us how to properly calculate sleep for custom gravity, Chronos can't support rigidbody sleep.

I noticed that there is a variable called Time.rigidbody.shouldSleep , but this is not referenced anywhere so does nothing as far as i know.

Oops, that property should have been removed. It's undocumented because it doesn't do anything. Will be removed in the next version.

Answer
Unity Bug

Hi Luna,

Unfortunately, that's a known issue. Because Chronos has to apply its own custom timescale-dependent gravity, the rigidbody constantly gets awoken.

 In the early versions, I tried manually setting it to sleep by calculating its mass-normalized velocity and comparing it to the physics manager's sleep threshold, but that gave unpredictable results that were inconsistent with Unity's default sleep behaviour. See: https://forum.unity3d.com/threads/how-to-calculate-a-rigidbodys-mass-normalized-energy-for-sleepthreshold.311941/

Until Unity chimes in and tells us how to properly calculate sleep for custom gravity, Chronos can't support rigidbody sleep.