[Activated!] Sleeping Part Behavior Improvements

We have some behavior improvements to the physics engine ready to test now in Studio!

What’s a sleeping part?

The Roblox physics engine, like many others, uses a “sleep” system for simulated objects. Basically, when a part comes to rest, we mark it as “sleeping” and stop performing physics calculations, which freezes it in place as if it was anchored. Then, one of many different events can cause that part to “awake”, and begin performing physics calculations again.

All of this happens in the background so you ideally don’t need to worry about it. Most games have parts properly going to sleep and waking up all the time.

Unfortunately, it hasn’t been perfect. Various edge cases have been reported where parts freeze in place because they fell asleep too early, or just won’t wake up.


The cylinder falls asleep after being motionless for a bit, rather than rolling down the slope.


The large block stops moving since the small block is asleep, rather than pulling it along.

What’s changing?

We’ve totally changed how we determine when parts should go to sleep and wake up, allowing for the above broken example to work with total success. These changes should fix tons of the past reported bugs related to sleep, and we’ve been working hard to make sure existing physics mechanisms continue to work as expected.


The cylinder correctly rolls down the slope


The small block wakes up and begins moving once pulled.

Other than these broad behavior improvements, some specific fixes include:

  • Switching from zero-gravity to non-zero gravity will now wake up all sleeping parts
  • Parts connected to animated assemblies (Motor6Ds) will properly wake up when under motion
  • Fix cases where parts would wake up when they didn’t need to.

Why beta?

Any change to a core physics system like this has the potential to create all sorts of unintended, unexpected issues. While we’ve tested lots of cases, we would hate to turn this on and see a bunch of games break. This beta allows you to test out your existing games, and make sure you don’t start seeing unexpected behavior.

Why didn’t you just give us an API to handle sleep edge cases?

This isn’t off the table. We just wanted to make these improvements since we knew the baseline could be a lot better. If we had provided an API before, there would have been little motivation to make these improvements in the first place!

Of course, if we do receive a sufficient number of cases that do not seem reasonable to have fixed with a general change, an API will be provided. The specifics of it depend on the edge cases we need to handle. So please feel free to share cases related to sleep that still appear to be broken!

Please enable this beta feature now and test your games! As long as everything goes smoothly, we will enable it everywhere after a week.

356 Likes

This topic was automatically opened after 14 minutes.

Does this generally apply to all cases where an object would previously sleep erroneously if it had zero velocity instantaneously? (e.g. when a part slowly/gently oscillating on a spring reaches the top or bottom of its oscillation)

31 Likes

Welp time to go see what people make with this. I will be using this and playing around with this as well for my new game I hope it get’s enabled soon.

15 Likes

Oh wow, this is something I really needed! It stopped me from working on a physics-based game I prototyped because the parts kept falling asleep and disrupting the collisions. I’ll take a look at it to see if it performs well now.

17 Likes

This is another massive yet very important change in Roblox.

Honestly 2019 has been great for this, and 2020 is looking even better.

I’m glad this was updated; physics sleep problems have been a problem for a very long time, and this is a great change on that.

Thank you.

24 Likes

Yea pretty much. We take “force imbalance” into account better. So if a part’s instantaneous velocity is 0, but there is still a unbalanced force applied to the part, it should stay awake.

23 Likes

This is an great improvement for Roblox, I hope there is going to be less unexcpected flungs now, which were in old version of Roblox very common. From the images I like the idea that blocks now automatically move once pulled.

5 Likes

Are there any expected performance gains or implications?

10 Likes

Nani?!?! Thanks for making this! I can finally create a physics game!

11 Likes

This is pretty ground breaking, because this allows for physics-based games to be more reliant on said physics. We’ve had a slew of issues with sleeping parts. One that comes to mind is this one about a hockey puck:

cc @Bananacb
cc @C_Sharper - Pretty sure you had a issue with sleeping parts in regards to bowling too.

13 Likes

Oh heck yeah! This update is amazing. Thank you!

Do you expect to deliver future updates in terms of physics ownership being transferred properly too? For example, when a physics owner part runs into another one, I hope ownership transfers accordingly.

14 Likes

Does this fix parts not being woken up by BodyForce/VectorForce in cases where very little force is being exerted? Tested newtonian space flight a while back and ran into issues with RCS thrusters not being able to move the ship around if it was sitting idle because they didn’t exert much force.

9 Likes

I personally would love it if the API was released. Theres many parts I would prefer to be constantly asleep without having to anchor it. Would make my life a lot easier haha.

15 Likes

Looks quite smooth and realistic, what a[color=cyan] cool[/color] update to the Physics Engine!

Thanks for especially changing to Non Zero Gravity! Would really change my life.

9 Likes

I like it, I gonna try it. ._.

4 Likes

Parts should stay awake with lower accelerations or forces than before.
However, it is still finite. We can’t support infinitesimally small forces/velocities.

You should try your space flight with the change enabled and see if it works! Otherwise, maybe scaling things up a bit could help?

7 Likes

Could you elaborate? Why do you want to keep something asleep rather than keep it anchored?

7 Likes

Let’s say these edge cases don’t occur in my games and this feature is still on. Will it have an impact on performance?

5 Likes