# Body activationControl and force of gravity

**URL:** <https://forum.babylonjs.com/t/body-activationcontrol-and-force-of-gravity/52996>\
**Category:** Bugs\
**Tags:** physics, havok\
**Created:** [August 24, 2024, 10:23pm UTC](https://forum.babylonjs.com/t/body-activationcontrol-and-force-of-gravity/52996 "2024-08-24T22:23:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![HiGreg](https://avatars.discourse-cdn.com/v4/letter/h/c5a1d2/32.png) [@HiGreg](https://forum.babylonjs.com/u/HiGreg)\
**Post date:** [August 24, 2024, 10:23pm UTC](https://forum.babylonjs.com/t/body-activationcontrol-and-force-of-gravity/52996/1 "2024-08-24T22:23:31Z")

</div>

When there are no collisions and only gravity on a pendulum, I’m seeing some unexpected sleep behavior. This easily-editable playground shows the effects.

> **[Babylon.js Playground](https://playground.babylonjs.com/#NAMYYQ%2321)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

Neither [applying a zero force](https://forum.babylonjs.com/t/havok-wake-up-from-sleep-mode/40852/5) nor setting ActivationControl seems to wake up a physicsBody.

The [original forum thread](https://forum.babylonjs.com/t/havok-precision/52959/5) where this started.

The playground also shows that an engine gravity value of zero vector is different than a small non-zero value (e.g. -0.01).

The expected outcome is that with engine gravity and without applyForce, ActivationControl should result in all balls aligned after settling.

Also, it would be very useful if a tolerance could be specified for sleep/activation. It might be useful for each body to allow a different tolerance.

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [August 26, 2024, 8:47am UTC](https://forum.babylonjs.com/t/body-activationcontrol-and-force-of-gravity/52996/2 "2024-08-26T08:47:32Z")

</div>

so, if I sum it up correctly, you want a way to set a speed/torque threshold value for setting bodies to sleep?

---

<div class="post-metadata">

**Author:** ![HiGreg](https://avatars.discourse-cdn.com/v4/letter/h/c5a1d2/32.png) [@HiGreg](https://forum.babylonjs.com/u/HiGreg)\
**Post date:** [August 27, 2024, 2:06pm UTC](https://forum.babylonjs.com/t/body-activationcontrol-and-force-of-gravity/52996/3 "2024-08-27T14:06:35Z")

</div>

Yes. My idea was to set it to something just below “shimmering” where a body would go to sleep when the imposed velocity is not visible. However, that’s complicated by whether there are constraints and when exactly the threshold is applied. My current thought is that the threshold needs to be applied after constraints and, perhaps to each resultant orthogonal vector.I’ll need more experiments to hone my recommendation, because if applied prior to constraints on the entire force, gravity (as a constant) will always (or never) be thresholded.

It’s also complicated by varying resolutions. But I woudn’t expect automatic accomodation of resolution. Though if possible, that would be awesome.

You may already know enough to apply the recommendation to obtain the expected and performant effect?
