Physics sleep: Difference between revisions
link to Object
(Added category) |
(link to Object) Tags: Mobile edit Mobile web edit Advanced mobile edit |
||
Line 1: | Line 1: | ||
You may have encountered a situation where there is a physics object, and a script suddenly removes the floor it's resting on, yet it doesn't fall down. Usually this happens when an object falls asleep. | You may have encountered a situation where there is a physics [[object]], and a script suddenly removes the floor it's resting on, yet it doesn't fall down. Usually this happens when an object falls asleep. | ||
Simulating physics requires a lot of computing power, so the physics engine puts objects that haven't been active to sleep. This usually happens after 120 frames (2 seconds) if the object's [[Get Velocity|velocity]] is low enough. Sleeping objects use up very little resources, and if something happens to them, they'll automatically wake up and react to that. | Simulating physics requires a lot of computing power, so the physics engine puts objects that haven't been active to sleep. This usually happens after 120 frames (2 seconds) if the object's [[Get Velocity|velocity]] is low enough. Sleeping objects use up very little resources, and if something happens to them, they'll automatically wake up and react to that. |