# Character Controller and Havok Collisions?

**URL:** <https://forum.babylonjs.com/t/character-controller-and-havok-collisions/42083>\
**Category:** Questions\
**Created:** [July 1, 2023, 5:34am UTC](https://forum.babylonjs.com/t/character-controller-and-havok-collisions/42083 "2023-07-01T05:34:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigrig](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bigrig/32/5548_2.png) [@bigrig](https://forum.babylonjs.com/u/bigrig)\
**Post date:** [July 1, 2023, 5:34am UTC](https://forum.babylonjs.com/t/character-controller-and-havok-collisions/42083/1 "2023-07-01T05:34:24Z")

</div>

Hi all -  
I’m trying to add havok collisions to an animated character, controlled by ssatguru’s character controller. The objective is to detect when the character runs into objects.

I’m failing pretty bad here:

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

 ![Screenshot 2023-06-30 at 10.32.20 PM](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/1/8/188f0f802e630b1897dcb2f7925da10cf70a8fc6.jpeg)

Im thinking that the issue is more than it being a box or a capsule - in that there’s some concept I’m missing here to be able to both have the character stand upright and still move with collisions using physics engine??

thanks so much for any advice.

---

<div class="post-metadata">

**Author:** ![qq2315137135](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/qq2315137135/32/32219_2.png) [@qq2315137135](https://forum.babylonjs.com/u/qq2315137135)\
**Post date:** [July 1, 2023, 8:07am UTC](https://forum.babylonjs.com/t/character-controller-and-havok-collisions/42083/2 "2023-07-01T08:07:06Z")

</div>

Currently you can use

```auto
javascript body.setMassProperties({ inertia: BABYLON.Vector3.Zero() })

```

to prevent the physical body from tipping over

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

As for movement, you can apply force to the character.

---

<div class="post-metadata">

**Author:** ![bigrig](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bigrig/32/5548_2.png) [@bigrig](https://forum.babylonjs.com/u/bigrig)\
**Post date:** [July 1, 2023, 2:26pm UTC](https://forum.babylonjs.com/t/character-controller-and-havok-collisions/42083/3 "2023-07-01T14:26:40Z")

</div>

> [@qq2315137135](#):
>
> `inertia`

Thanks. The character is tipped over though even still, yea?  
 ![Screenshot 2023-07-01 at 7.24.30 AM](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/7/8/78256b51b3152a7d936bf54e9a0f4fee57cce004.png)

Is there a method to only use collisions from havok - and to ignore everything else about the physics world? Ie: to continue using character controller to navigate the character around the world? Or is this kind of character controller just not going to work - and i need to re-write it using physics forces to move the character instead?

For reference, here is the controller working without the physics attached:

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

---

<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:** [July 3, 2023, 12:40pm UTC](https://forum.babylonjs.com/t/character-controller-and-havok-collisions/42083/4 "2023-07-03T12:40:15Z")

</div>

> [@bigrig](#):
>
> Or is this kind of character controller just not going to work - and i need to re-write it using physics forces to move the character instead?

Yep, this character controller is meant to work without physics, so you’d have to change how it works to use with Havok

---

<div class="post-metadata">

**Author:** ![bigrig](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bigrig/32/5548_2.png) [@bigrig](https://forum.babylonjs.com/u/bigrig)\
**Post date:** [July 3, 2023, 2:03pm UTC](https://forum.babylonjs.com/t/character-controller-and-havok-collisions/42083/5 "2023-07-03T14:03:14Z")

</div>

Ah, suspected. Thanks for confirmation. Bummer.

---

<div class="post-metadata">

**Author:** ![bigrig](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bigrig/32/5548_2.png) [@bigrig](https://forum.babylonjs.com/u/bigrig)\
**Post date:** [August 3, 2023, 11:18pm UTC](https://forum.babylonjs.com/t/character-controller-and-havok-collisions/42083/6 "2023-08-03T23:18:17Z")

</div>

I finally got this more worked out:

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

---

<div class="post-metadata">

**Author:** ![MackeyK24](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mackeyk24/32/3741_2.png) [@MackeyK24](https://forum.babylonjs.com/u/MackeyK24)\
**Post date:** [March 13, 2024, 12:24pm UTC](https://forum.babylonjs.com/t/character-controller-and-havok-collisions/42083/7 "2024-03-13T12:24:14Z")

</div>

[My Babylon Toolkit - Character Controller Demo Playground](https://playground.babylonjs.com/index.html?BabylonToolkit#V9AUOR)
