character_controller_slopes
If sliding is enabled, the character can automatically climb slopes if they are not too steep, or slide down slopes if they are too steep. Sliding is configured by the following parameters:
- The max slope climb angle: if the angle between the slope to climb and the horizontal floor is larger than this value, then the character won’t be able to slide up this slope.
- The min slope slide angle: if the angle between the slope and the horizontal floor is smaller than this value, then the vertical component of the character’s movement won’t result in any sliding.
info
As always in Rapier, angles are specified in radians.
let characterController = world.createCharacterController(0.01);
// Don’t allow climbing slopes larger than 45 degrees.
characterController.setMaxSlopeClimbAngle(45 * Math.PI / 180);
// Automatically slide down on slopes smaller than 30 degrees.
characterController.setMinSlopeSlideAngle(30 * Math.PI / 180);