# setPivotMatrix behaves strange in combination with cannon.js physics

**URL:** <https://forum.babylonjs.com/t/setpivotmatrix-behaves-strange-in-combination-with-cannon-js-physics/3526>\
**Category:** Bugs\
**Created:** [May 26, 2019, 8:14pm UTC](https://forum.babylonjs.com/t/setpivotmatrix-behaves-strange-in-combination-with-cannon-js-physics/3526 "2019-05-26T20:14:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christopher\_Stock](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/christopher_stock/32/2399_2.png) [@Christopher\_Stock](https://forum.babylonjs.com/u/Christopher_Stock)\
**Post date:** [May 26, 2019, 8:14pm UTC](https://forum.babylonjs.com/t/setpivotmatrix-behaves-strange-in-combination-with-cannon-js-physics/3526/1 "2019-05-26T20:14:49Z")

</div>

After upgrading to babylon.JS 3.2 / 4.0 I noticed, that most of my (static) physical objects behaved strange and started moving through the scene … I analyzed the issue and found out, that the culprit was the assignment of a different Pivot using `setPivotMatrix` for certain meshes.

Please see this Playground:  
[https://playground.babylonjs.com/#7149G4#45](https://playground.babylonjs.com/#7149G4#45)  
The **static** box starts and keeps on moving although its mass is set to `0`.

In the `// problematic section ..`, a PivotMatrix is set.  
I already read your article about the breaking changes concerning the `setPivotMatrix` method and it’s second (boolean) parameter but I’ve tried everything to get this issue fixed! ( also using `false` or `true` did not solve this issue.

Do you know, how to solve this issue and how to use the pivot matrices in combination with cannon.js again? Any help would be greatly appreciated! 😃

Thanks in advance and keep up your awesome work on babylon.JS !  
🥰🥰🥰

Christopher

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [May 27, 2019, 1:08pm UTC](https://forum.babylonjs.com/t/setpivotmatrix-behaves-strange-in-combination-with-cannon-js-physics/3526/2 "2019-05-27T13:08:59Z")

</div>

I wonder if it could be related to some of the physics fixes done by @trevordev on the 4.0 release.

I know some pivot bugs have been fixed around this space on 4.0.

@trevordev could you have a quick look at it ?

---

<div class="post-metadata">

**Author:** ![trevordev](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/trevordev/32/16_2.png) [@trevordev](https://forum.babylonjs.com/u/trevordev)\
**Post date:** [May 29, 2019, 12:19am UTC](https://forum.babylonjs.com/t/setpivotmatrix-behaves-strange-in-combination-with-cannon-js-physics/3526/3 "2019-05-29T00:19:39Z")

</div>

@Christopher_Stock Unfortunately reverting the cannonjsplugin file did not seem to resolve this so I have a couple questions to make sure I can get this fix right.

Other than not moving when mass is set to 0 is there any other behavior you need based on these pivots?

Are you ever using pivots and setting mass?

Can you confirm that the collision worked as expected when another object collided with them in 3.2?

What was the reason you ended up using pivots?
