# Cylinder positioning off (maybe changed?)

**URL:** <https://forum.babylonjs.com/t/cylinder-positioning-off-maybe-changed/26179>\
**Category:** Questions\
**Created:** [December 19, 2021, 10:33pm UTC](https://forum.babylonjs.com/t/cylinder-positioning-off-maybe-changed/26179 "2021-12-19T22:33:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![james-3d](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@james-3d](https://forum.babylonjs.com/u/james-3d)\
**Post date:** [December 19, 2021, 10:33pm UTC](https://forum.babylonjs.com/t/cylinder-positioning-off-maybe-changed/26179/1 "2021-12-19T22:33:24Z")

</div>

Hi. A while back I used this playground to make some cylinders and balls  
[https://www.babylonjs-playground.com/#1RWE59#12](https://www.babylonjs-playground.com/#1RWE59#12)

My script now has cylinders misaligned, similar to the cylinder in the playground now being misaligned. Any thoughts on getting this playground back to working order?  
Thank you!

---

<div class="post-metadata">

**Author:** ![JohnK](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/johnk/32/26764_2.png) [@JohnK](https://forum.babylonjs.com/u/JohnK)\
**Post date:** [December 20, 2021, 9:11am UTC](https://forum.babylonjs.com/t/cylinder-positioning-off-maybe-changed/26179/2 "2021-12-20T09:11:30Z")

</div>

Hi @james-3d an welcome back. There was a breaking change in `setPivotMatrix` a couple of years ago [Pivots | Babylon.js Documentation](https://doc.babylonjs.com/divingDeeper/mesh/transforms/parent_pivot/pivots#breaking-change). You now need to add a false parameter to older projects [https://www.babylonjs-playground.com/#1RWE59#387](https://www.babylonjs-playground.com/#1RWE59#387)

---

<div class="post-metadata">

**Author:** ![james-3d](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@james-3d](https://forum.babylonjs.com/u/james-3d)\
**Post date:** [December 20, 2021, 6:00pm UTC](https://forum.babylonjs.com/t/cylinder-positioning-off-maybe-changed/26179/3 "2021-12-20T18:00:07Z")

</div>

Thank you, @JohnK. Nice targeting. You got me working, again

I had a divide-by-4 rather than a divide-by-2 in [https://www.babylonjs-playground.com/#1RWE59#387](https://www.babylonjs-playground.com/#1RWE59#387). If you change the ‘2’ to a ‘4’ in this playground, it shows my issue. My cylinders are back in their rightful place. Thank you!

```auto
good
    // First of all we have to set the pivot not in the center of the cylinder:
    cylinder.setPivotMatrix(BABYLON.Matrix.Translation(0, -distance / 2, 0), false);
bad
    // First of all we have to set the pivot not in the center of the cylinder:
    cylinder.setPivotMatrix(BABYLON.Matrix.Translation(0, -distance / 4, 0), false);

```
