# PhysicsCharacterController drift, friction ignored

**URL:** <https://forum.babylonjs.com/t/physicscharactercontroller-drift-friction-ignored/56822>\
**Category:** Bugs\
**Tags:** physics, character-controller\
**Created:** [February 27, 2025, 2:47am UTC](https://forum.babylonjs.com/t/physicscharactercontroller-drift-friction-ignored/56822 "2025-02-27T02:47:59Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eshku](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/eshku/32/45180_2.png) [@Eshku](https://forum.babylonjs.com/u/Eshku)\
**Post date:** [February 27, 2025, 2:47am UTC](https://forum.babylonjs.com/t/physicscharactercontroller-drift-friction-ignored/56822/1 "2025-02-27T02:47:59Z")

</div>

PhysicsCharacterController.calculateMovement seems to keep velocity no matter what surface friction \ controller friction is, I can not tell the difference between 0 and 10000 friction on both controller and ground.

Simplified PG based on controller doc:

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

---

<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:** [February 27, 2025, 9:42am UTC](https://forum.babylonjs.com/t/physicscharactercontroller-drift-friction-ignored/56822/2 "2025-02-27T09:42:37Z")

</div>

I’ve found 1 factor that has not been exposed yet. I guess you wanted to increase friction to have no progressive velocity?

---

<div class="post-metadata">

**Author:** ![Eshku](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/eshku/32/45180_2.png) [@Eshku](https://forum.babylonjs.com/u/Eshku)\
**Post date:** [February 27, 2025, 10:04am UTC](https://forum.babylonjs.com/t/physicscharactercontroller-drift-friction-ignored/56822/3 "2025-02-27T10:04:05Z")

</div>

Initially I wanted just faster velocity dampening, so it’s not as “drifty” on surfaces.

But surface friction is important feature to have, so is controller physics body friction for different entities.

---

<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:** [February 27, 2025, 10:05am UTC](https://forum.babylonjs.com/t/physicscharactercontroller-drift-friction-ignored/56822/4 "2025-02-27T10:05:34Z")

</div>

Assigned @Cedric on February 27, 2025, 10:05am UTC



---

<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:** [February 27, 2025, 10:12am UTC](https://forum.babylonjs.com/t/physicscharactercontroller-drift-friction-ignored/56822/5 "2025-02-27T10:12:22Z")

</div>

There is this gain/maxDelta that controls acceleration.

> <https://github.com/BabylonJS/Babylon.js/blob/bfdd2fdbb8bd2f0ce1bb1038ac4f262fca16cc5b/packages/dev/core/src/Physics/v2/characterController.ts#L1523>

Setting the gain to 1 makes the controller to start/stop immediately. It’s in addition to friction. I’ll try to make another PG to demonstrate that. But for now, I’ll do a PR to expose these values.

---

<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:** [February 27, 2025, 10:31am UTC](https://forum.babylonjs.com/t/physicscharactercontroller-drift-friction-ignored/56822/6 "2025-02-27T10:31:03Z")

</div>

> <https://github.com/BabylonJS/Babylon.js/pull/16225>
>
> Follow up https://forum.babylonjs.com/t/physicscharactercontroller-drift-frictio…n-ignored/56822
> 
> PG : http://playground.babylonjs.com/#K3IU33#4

---

<div class="post-metadata">

**Author:** ![Eshku](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/eshku/32/45180_2.png) [@Eshku](https://forum.babylonjs.com/u/Eshku)\
**Post date:** [February 27, 2025, 8:08pm UTC](https://forum.babylonjs.com/t/physicscharactercontroller-drift-friction-ignored/56822/7 "2025-02-27T20:08:32Z")

</div>

Tested it a little, acceleration works nicely as general purpose thing (maybe someday I’ll split it into acceleration & de-acceleration once I figure out how to git properly, that could allow more flexibility).

About friction - I did not read through physics code, but I tested on the same PG - ground friction does not affect controller:

> **[Babylon.js Playground](https://playground.babylonjs.com/?snapshot=refs%2Fpull%2F16225%2Fmerge#K3IU33%236)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL and WebGPU 3D scenes

(lowered speed, added velocity output before render and console clear on restart)

Velocity is about the same no matter how high or low friction on surface physics aggregate is set. It is slightly different between runs, but overall ~about the same values.  
I hit 0.60 =\> 1.20 =\> 1.41(max) sequence on frictions 0,1 and 1000.

I think controller should consider surface it is moving on for ice physics vs solid ground (as simple example) and apply difference in calculateMovement.

Also I’m noticing both Physics Body and Physics Aggregate have only one friction.  
Is it static or dynamic or both?

---

<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:** [March 10, 2025, 10:14am UTC](https://forum.babylonjs.com/t/physicscharactercontroller-drift-friction-ignored/56822/8 "2025-03-10T10:14:31Z")

</div>

Sorry I missed your question 😕  
PhysicsMaterial friction (used by the aggregate) is static friction.

---

<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:** [June 24, 2025, 8:33am UTC](https://forum.babylonjs.com/t/physicscharactercontroller-drift-friction-ignored/56822/9 "2025-06-24T08:33:57Z")

</div>

Unassigned @Cedric on June 24, 2025, 8:33am UTC


