# Babylon.PhysicsCharacterController Usage

**URL:** <https://forum.babylonjs.com/t/babylon-physicscharactercontroller-usage/61206>\
**Category:** Questions\
**Created:** [October 29, 2025, 8:49pm UTC](https://forum.babylonjs.com/t/babylon-physicscharactercontroller-usage/61206 "2025-10-29T20:49:42Z")\
**Posts on this page:** 12\
**Page:** 1

<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:** [October 29, 2025, 8:49pm UTC](https://forum.babylonjs.com/t/babylon-physicscharactercontroller-usage/61206/1 "2025-10-29T20:49:42Z")

</div>

Hey @Cedric I am still having issues with getting my chracter controller working like you have the BABYLON.PhysicsCharaterController.

I cant use (and frankly dont fully understand) your implmentation for movement, which is beautifully smooth, by the way, especalliy the stairs and slopes… Just beautiful 🙂

From this snippet here:

```auto
const support = characterController.checkSupport(dt, down);
const desiredLinearVelocity = getDesiredVelocity(dt, support, characterCurrentOrientation, characterCurrentVelocity);
characterController.setVelocity(desiredLinearVelocity);
characterController.integrate(dt, support, characterGravity);
const newPosition = characterController.getPosition();

```

and what you have at [https://playground.babylonjs.com/?inspectorv2=true#WO0H1U#13](https://playground.babylonjs.com/?inspectorv2=true#WO0H1U#13)

I cant really tell what is the full rhyme or reason for movement code.

What is ACTUAL required code to move (with collisions) and what is just the sample code ?

Especalliy what in `getDesiredVelocity`

Is all that the Required way of doing movement or just the way you are handling things for this demo, which brings me back to what is required for movement.

I am so used to Unity and Ammo for character based movement both of which seem to move with collision by its move function with a moveVelocity. (Kinda how the basic Babylon mesh.moveWithCollisions works).

I raycast download to detect `IsGrounded` … etc…

I would luv to switch my BACKEND RIGIDBODY base character controller I created with just Pure Ridigbody physics with your offical BABYLON.PhysicsCharacterController

> **[Babylon.js Playground](https://playground.babylonjs.com/index.html?webgpu=&BabylonToolkit=&inspectorv2=true#C6XBI3)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL and WebGPU 3D scenes

Again… I am trying to fully understand what makes it tick so I can refactor my Unity Exported Character Controllers

Any detail information on how this really works:

```auto
const support = characterController.checkSupport(dt, down);
const desiredLinearVelocity = getDesiredVelocity(dt, support, characterCurrentOrientation, characterCurrentVelocity);
characterController.setVelocity(desiredLinearVelocity);
characterController.integrate(dt, support, characterGravity);
const newPosition = characterController.getPosition();

```

What is actually required to get that `moveWithCollisions` type movement we had with built-in babylon movement or btKinematicCharacterController from Ammo.js

Please feel free to DM me if needed.

---

<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:** [October 30, 2025, 10:03am UTC](https://forum.babylonjs.com/t/babylon-physicscharactercontroller-usage/61206/2 "2025-10-30T10:03:02Z")

</div>

`checkSupport`and `getDesiredVelocity` are both on user side. A speed is computed depending on game/experience and states. If character is walking in mud, speed will be reduced. `getDesiredVelocity` needs to know the support (and inputs) to compute a velocity.

Next, with that desired speed, `integrate`will compute the new position using the physics.

`moveWithCollision` computes a new position based on a desired position delta.

`integrate`is almost the same except the position delta is decomposed as velocity ( `desiredLinearVelocity` ) and dt.

deltaPosition = `desiredLinearVelocity` \* dt;

That decomposition of time+speed instead of delta distance allows more possibilities.

So, to replace moveWithCollision by character controller integrate, you need to compute a velocity. As you have the delta position (current mesh position + displacement), you can compute the speed as displacement / deltaTime.

To replace do the opposite, displacement is speed \* deltaTime.

I think the checkSupport method should now have been on the characterController side and put in a different conceptual piece of code. It’s misleading to check support on character controller, then tweak speed on user side and then integrate it. Separation could be better.

EDIT: thinking more about it. If you provide default CharacterSurfaceInfo parameter for `integrate`call, with `supportedState:CharacterSupportedState.UNSUPPORTED` then you should have complete control on desiredVelocity and you are free to add or not gravity for example.

---

<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:** [October 30, 2025, 10:34am UTC](https://forum.babylonjs.com/t/babylon-physicscharactercontroller-usage/61206/3 "2025-10-30T10:34:30Z")

</div>

I guess it’s possible to add a new `moveWithCollision` method that would do the conversion. It would take a same parameters as that method and would use a ‘dummy’ CharacterSupportedState. Would it help?

---

<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:** [October 30, 2025, 10:57am UTC](https://forum.babylonjs.com/t/babylon-physicscharactercontroller-usage/61206/4 "2025-10-30T10:57:29Z")

</div>

OMG… that would be a great help.

I have all my code already calculated to FIXED FRAMERATE COMPENSATED movement velocity. I was using this value to move my rigidbody character controller with setLinearVelocity.

If you made a moveWithCollision function, i should be able to feed that same exact movement velocity to your new moveWithCollision function

---

<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:** [October 30, 2025, 10:58am UTC](https://forum.babylonjs.com/t/babylon-physicscharactercontroller-usage/61206/5 "2025-10-30T10:58:59Z")

</div>

Cool. I’ll give it a try beginning of next week. I’ll ping you for feedback when I have a draft PR opened.

---

<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:** [October 30, 2025, 10:59am UTC](https://forum.babylonjs.com/t/babylon-physicscharactercontroller-usage/61206/6 "2025-10-30T10:59:04Z")

</div>

Assigned @Cedric on October 30, 2025, 10:59am UTC



---

<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:** [October 30, 2025, 10:59am UTC](https://forum.babylonjs.com/t/babylon-physicscharactercontroller-usage/61206/7 "2025-10-30T10:59:39Z")

</div>

Thank you so much 🙂

---

<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:** [November 12, 2025, 10:36am UTC](https://forum.babylonjs.com/t/babylon-physicscharactercontroller-usage/61206/8 "2025-11-12T10:36:27Z")

</div>

Sorry for the delay! No progress but it’s still on my radar, I do not forget you 🙂

---

<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:** [November 27, 2025, 10:05am UTC](https://forum.babylonjs.com/t/babylon-physicscharactercontroller-usage/61206/9 "2025-11-27T10:05:20Z")

</div>

Finally! [CharacterController update by CedricGuillemet · Pull Request #17514 · BabylonJS/Babylon.js · GitHub](https://github.com/BabylonJS/Babylon.js/pull/17514)

---

<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:** [November 27, 2025, 3:51pm UTC](https://forum.babylonjs.com/t/babylon-physicscharactercontroller-usage/61206/10 "2025-11-27T15:51:26Z")

</div>

OMG @Cedric That looks SOOOOOO MUCH cleaner and much easier to use.

I have **NOT** tested it yet, moveWithCollisions not published yet… but the code so clean on the playground:

```auto
BABYLON.Quaternion.FromEulerAnglesToRef(0,camera.rotation.y, 0, characterOrientation);
const displacement = inputDirection.scale(dt * 2.).applyRotationQuaternion(characterOrientation);
characterController.moveWithCollisions(displacement);

```

CANT WAIT TO CHECK IT OUT

THANK YOU VERY MUCH 🙂

---

<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:** [November 27, 2025, 3:56pm UTC](https://forum.babylonjs.com/t/babylon-physicscharactercontroller-usage/61206/11 "2025-11-27T15:56:51Z")

</div>

I’m so glad you like it 🙂 I’m adding a couple more features for characterController in the same PR so you have plenty of time to test it and send your feedback!

---

<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:** [December 5, 2025, 9:49am UTC](https://forum.babylonjs.com/t/babylon-physicscharactercontroller-usage/61206/12 "2025-12-05T09:49:08Z")

</div>

Unassigned @Cedric on December 5, 2025, 9:49am UTC


