I would prefer to use 0 or normal gravity for movement or you will have some issues later, for sliding you can calculate ground (vertex) angle against character
If angle > 45° f.e you will set gravity to -9.81
You can do couple calculations to set direction of sliding based on angle data.
Use raycast to get ground vertex and calculate its angle against player.
Somebody on this forum already did this, try find it.
player.position.y = 30; line 31: The character was very top and took a long time to land on the ground with a lower gravity
the ellipsoid : line 32
velocity.y = 0; line 36
velocity.y += (scene.gravity.y / 100) * delta; : line 45 (Here by default scene.gravity.y has a value of 9.81. This value works best with physics. I divide it by 100)
It works better now.
However it is normal that with a strong gravity, a character slides along the slopes (as in real life) Now your gravity is low, so if your character jumps, it will take longer to land.
@gbz can i be REALLY cheeky and ask if you could edit your playground example to rotate the camera with A and D keypresses? I’ve had a go myself but i’m relatively new to the front-end side of development. If not, it’s fine but would really help.
Also, is there a solution for the stuttering when walking down the slope?
However, I’m not sure how to set the sensitivity of camera rotation by A and D keypresses. We can set the sensitivity of camera rotation by mouse movement using
Been thinking about the stuttering of the player while moving down the slide, but not sure at the moment how to fix this. This behavior is dependent on the player’s horizontal speed, scene gravity, and more.