Looking for options on how to jump and keep character grounded

Hi there,
After some readings and attempts to use gravity in the scene, I see now that there is no such a thing as applyGravity to a Mesh :smiley:

I implemented this naive implementation to gravity and jump, inputs are welcome for options on how to improve it. https://playground.babylonjs.com/#9E56KA#3


1 Like

Hey there, here’s the playground with sone minimal changes to use the default physics engine (cannon). The new code is all on lines 21-28. Note to use it away from the playground you’d need to manually include/link the cannon script, e.g. at https://cdn.babylonjs.com/cannon.js or https://preview.babylonjs.com/cannon.js, depending on what version of Babylon you’re using.:slightly_smiling_face:

1 Like

Thanks @Blake
I guess the side effect is that all obstacles in the scene will need a PhysicsImpostor attached to it, I will measure the extra amount of memory that is need. but the movement is smoother :slight_smile: