# Physics: w/o global gravity, Cannon.js ignores friction, Ammo.js totally broken

**URL:** <https://forum.babylonjs.com/t/physics-w-o-global-gravity-cannon-js-ignores-friction-ammo-js-totally-broken/9754>\
**Category:** Bugs\
**Created:** [April 6, 2020, 11:15am UTC](https://forum.babylonjs.com/t/physics-w-o-global-gravity-cannon-js-ignores-friction-ammo-js-totally-broken/9754 "2020-04-06T11:15:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joerg\_Plewe](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/joerg_plewe/32/7426_2.png) [@Joerg\_Plewe](https://forum.babylonjs.com/u/Joerg_Plewe)\
**Post date:** [April 6, 2020, 11:15am UTC](https://forum.babylonjs.com/t/physics-w-o-global-gravity-cannon-js-ignores-friction-ammo-js-totally-broken/9754/1 "2020-04-06T11:15:41Z")

</div>

I observed some strange behavior of Cannon.js in case there is no global gravitation configured (`enablePhysics()`), but the gravitational force is provided with `applyForce()` each physics update cycle. IMHO this should not make a big difference. But it looks as if friction is completely ignored then.

Using Ammo.js instead gives a totally broken motion.

Oimo behaves differently, but still somehow reasonable.

The effect can be seen here: [Babylon.js Playground](https://playground.babylonjs.com/#3STT3N)

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [April 6, 2020, 3:48pm UTC](https://forum.babylonjs.com/t/physics-w-o-global-gravity-cannon-js-ignores-friction-ammo-js-totally-broken/9754/2 "2020-04-06T15:48:06Z")

</div>

Pinging @Cedric

---

<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:** [April 6, 2020, 4:01pm UTC](https://forum.babylonjs.com/t/physics-w-o-global-gravity-cannon-js-ignores-friction-ammo-js-totally-broken/9754/3 "2020-04-06T16:01:17Z")

</div>

You need to build a new Vector3 for applyForce second parameter.

[https://playground.babylonjs.com/#3STT3N#7](https://playground.babylonjs.com/#3STT3N#7)

Once fixed with Ammo, the friction is visible.

---

<div class="post-metadata">

**Author:** ![Joerg\_Plewe](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/joerg_plewe/32/7426_2.png) [@Joerg\_Plewe](https://forum.babylonjs.com/u/Joerg_Plewe)\
**Post date:** [April 6, 2020, 5:06pm UTC](https://forum.babylonjs.com/t/physics-w-o-global-gravity-cannon-js-ignores-friction-ammo-js-totally-broken/9754/4 "2020-04-06T17:06:33Z")

</div>

Ah, thank you so much @Cedric!, I’d never ever figured that out :). Worth a notice in the documentation that the vector is not read-only?

What about the first parameter? Can it be reused?
