I’m trying to move a camera around as you would in an FPS game.
I’m using ground created from a heightmap, on which I correct the camera’s Y position instead of using actual collision detection with the ground (the latter drops framerate considerably on larger meshes).
This works fine, except if I reduce the gravity in the scene - this causes the camera to ‘jitter’ on the Y axis:
Have you tried moving the camera by calling moveWithCollisions Instead of setting the position directly? For your jumping behavior, you could use an isJumping flag that, while true, disables or lowers gravity until it reaches some condition.
You can have a look at this example - https://playground.babylonjs.com/#NT4QZ8#7
Also note, that for jumping you may not need to change the gravity, it is enough just to move camera up.
Thank you for your replies. @jelster I haven’t tried that, but the reason I’m trying to avoid using the collisions against terrain is because it is a lot faster I believe: