Camera gravity issues

Hi,

I’ve made a playground. The ground is a custom mesh with a hole (lake) in the middle. When u walk next to it you get sucked inside from the gravity and the slope.
Why is gravity so powerful?
Shouldn’t the camera be supposed to be able to walk out of the hole walking up the slopes?

Once loaded the playground you can just walk ahead a few steps and it will happen.
Thanks :heartbeat:

Hi @Mescalina - Pinging @PolygonalSun to see if he has an idea.

Hey @Mescalina, so I was looking at your scene’s gravity vector and camera speed and you might want to change your gravity vector’s y value to something like -0.1 and increase your camera’s speed a bit because I don’t think that it has enough velocity to go up that high of a slope. Hopefully this helps. Here’s a good resource on cameras and collisions: Camera Collisions | Babylon.js Documentation (babylonjs.com)

Hi,
thanks a lot. Yeah it seems like a combination of less gravity and higher speed are the way to go, but it’s a fine tuning I struggle to get right and of course it depends a lot on the slops angle. It doesn’t seem to logic though to have to lower gravity in order to achieve such a standard task.

I’m building a virtual gallery so I just need basic camera physics to stay on the ground and collide and stop with obstacles. Is there a better way to implement this? Maybe I should do some raycasting to the ground and just keep the camera.y always connected to that?

The actual behavior gets the camera sucked inside any hole as soon as u start approaching the slope area. What I would like is a camera that follows the slopes but don’t slip on them, like having a full power friction on the material.

Any suggestions?
Thanks :heartbeat:

It actually appears that the problem was the wrong size of the camera.ellipsoid which was (1, 1, 1) instead of (0.5, 1, 0.5). I guess having a round collider is the issue.

TBH, if you only need gravity for the camera, raycasting might be a better alternative.

1 Like