# Physics air walking

**URL:** <https://forum.babylonjs.com/t/physics-air-walking/40251>\
**Category:** Questions\
**Created:** [April 26, 2023, 2:57pm UTC](https://forum.babylonjs.com/t/physics-air-walking/40251 "2023-04-26T14:57:35Z")\
**Posts on this page:** 8\
**Page:** 2

<div class="post-metadata">

**Author:** ![potato\_noob](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/potato_noob/32/25394_2.png) [@potato\_noob](https://forum.babylonjs.com/u/potato_noob)\
**Post date:** [April 27, 2023, 10:04pm UTC](https://forum.babylonjs.com/t/physics-air-walking/40251/21 "2023-04-27T22:04:46Z")

</div>

@DRLeria I don’t think you need to try and calculate the effects of gravity, because the scene has gravity, and we know the imposter already has a mass, so if you do a getLinearVelocityToRef to get the y component from the current velocity before we modify it on key press, and just preserve that, the engine will do all the work of incrementing and decrementing based on our dampening etc.

I did exactly what you just did a few hours ago trying to figure this out 😂 great minds!

---

<div class="post-metadata">

**Author:** ![DRLeria](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/drleria/32/50928_2.png) [@DRLeria](https://forum.babylonjs.com/u/DRLeria)\
**Post date:** [April 27, 2023, 10:20pm UTC](https://forum.babylonjs.com/t/physics-air-walking/40251/22 "2023-04-27T22:20:04Z")

</div>

Share a Playground please 🙏 🙏 🙏

[EDIT]

I got it 😁 😁  
Thanks for the solution 🖖 🖖 🖖

---

<div class="post-metadata">

**Author:** ![potato\_noob](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/potato_noob/32/25394_2.png) [@potato\_noob](https://forum.babylonjs.com/u/potato_noob)\
**Post date:** [April 27, 2023, 10:47pm UTC](https://forum.babylonjs.com/t/physics-air-walking/40251/23 "2023-04-27T22:47:07Z")

</div>

I still think we have more work to do 😂 should we be using setLinearVelocity or applyForce?

Impulse is an explosion, force is persistent more like movement, maybe what we’re doing is a bit of a lucky hack?

---

<div class="post-metadata">

**Author:** ![DRLeria](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/drleria/32/50928_2.png) [@DRLeria](https://forum.babylonjs.com/u/DRLeria)\
**Post date:** [April 28, 2023, 9:25am UTC](https://forum.babylonjs.com/t/physics-air-walking/40251/24 "2023-04-28T09:25:25Z")

</div>

Suee

An elaborate hack but it works, which is the important thing.

let’s wait for @Cedric opinion, he is our PhysicsGod 🙌🙌🙌

---

<div class="post-metadata">

**Author:** ![potato\_noob](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/potato_noob/32/25394_2.png) [@potato\_noob](https://forum.babylonjs.com/u/potato_noob)\
**Post date:** [April 28, 2023, 10:38am UTC](https://forum.babylonjs.com/t/physics-air-walking/40251/26 "2023-04-28T10:38:37Z")

</div>

Can’t tell if @voyile34 is a bot or just GPT’ed the response 🙃 “gear” link only slightly suspicious

---

<div class="post-metadata">

**Author:** ![DRLeria](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/drleria/32/50928_2.png) [@DRLeria](https://forum.babylonjs.com/u/DRLeria)\
**Post date:** [April 28, 2023, 10:55am UTC](https://forum.babylonjs.com/t/physics-air-walking/40251/27 "2023-04-28T10:55:17Z")

</div>

LOL!!! 🤣 🤣 🤣

---

<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:** [May 2, 2023, 10:01am UTC](https://forum.babylonjs.com/t/physics-air-walking/40251/28 "2023-05-02T10:01:24Z")

</div>

I would also use a raycast to check if on ground or not. Then play with linearvelocity/angularVelocity. This said, I’m adding a player controller in the Physics roadmap. It’s something important we didn’t have the chance to push for the 6.0 release.

---

<div class="post-metadata">

**Author:** ![potato\_noob](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/potato_noob/32/25394_2.png) [@potato\_noob](https://forum.babylonjs.com/u/potato_noob)\
**Post date:** [May 2, 2023, 10:49am UTC](https://forum.babylonjs.com/t/physics-air-walking/40251/29 "2023-05-02T10:49:51Z")

</div>

Thanks Cedric, good to get a high council view on this sort of thing, the setting linear velocity wiping out any gravity that had been applied was what was killing us off I think, the ray-cast is the icing on the cake I think we needed.

[Previous page](https://forum.babylonjs.com/t/physics-air-walking/40251.md?page=1)
