# Locking the rotation axis when using Physics

**URL:** <https://forum.babylonjs.com/t/locking-the-rotation-axis-when-using-physics/40270>\
**Category:** Questions\
**Created:** [April 27, 2023, 3:26am UTC](https://forum.babylonjs.com/t/locking-the-rotation-axis-when-using-physics/40270 "2023-04-27T03:26:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![javurtez](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/javurtez/32/31784_2.png) [@javurtez](https://forum.babylonjs.com/u/javurtez)\
**Post date:** [April 27, 2023, 3:26am UTC](https://forum.babylonjs.com/t/locking-the-rotation-axis-when-using-physics/40270/1 "2023-04-27T03:26:46Z")

</div>

Is it possible to lock a specific rotation axis when using Havok Physics? Does it have the same as in Unity where you can lock the z axis to avoid rotating it forward when an object collides.

> **[Unity - Scripting API: Rigidbody.constraints](https://docs.unity3d.com/ScriptReference/Rigidbody-constraints.html)**

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [April 27, 2023, 12:35pm UTC](https://forum.babylonjs.com/t/locking-the-rotation-axis-when-using-physics/40270/2 "2023-04-27T12:35:40Z")

</div>

Hello and welcome to the Babylon community! You can lock individual axis using the 6DoF constraint: [Physics6DoFConstraint | Babylon.js Documentation (babylonjs.com)](https://doc.babylonjs.com/typedoc/classes/BABYLON.Physics6DoFConstraint)

---

<div class="post-metadata">

**Author:** ![Raggar](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raggar/32/20672_2.png) [@Raggar](https://forum.babylonjs.com/u/Raggar)\
**Post date:** [April 27, 2023, 12:48pm UTC](https://forum.babylonjs.com/t/locking-the-rotation-axis-when-using-physics/40270/3 "2023-04-27T12:48:44Z")

</div>

Have a look at this thread: ["moveWithCollisions" with havoc? - #12 by aWeirdo](https://forum.babylonjs.com/t/movewithcollisions-with-havoc/40118/12)  
Setting some axis of the inertia to zero should be the same as locking an axis by multiplying the same axis by zero, as other physics engines do. At least I think so 😛
