character_controller_offset
For performance and numerical stability reasons, the character controller will attempt to preserve a small gap between
the character shape and the environment. This small gap is named offset and acts as a small margin around the character
shape. A good value for this offset is something sufficiently small to make the gap unnoticeable, but sufficiently large
to avoid numerical issues (if the character seems to get stuck inexplicably, try increasing the offset).
The offset is set with r3KinematicCharacterController_SetOffset. Like every length of the character controller, it
is given as an R3CharacterLength: its value is either an absolute length (if its relative field is 0), or a
factor multiplied by the height of the character’s shape (if its relative field is 1). The current offset is
given by r3KinematicCharacterController_Offset.
// The character offset is set to 0.01.
r2KinematicCharacterController_SetOffset(character_controller,
(R2CharacterLength){.value = 0.01, .relative = 0});
// The character offset is set to 0.01 multiplied by the shape's height.
r2KinematicCharacterController_SetOffset(character_controller,
(R2CharacterLength){.value = 0.01, .relative = 1});
If the character still gets stuck when sliding against surfaces, the small distance by which its motion is pushed
along the normals of the obstacles hit can also be increased with r3KinematicCharacterController_SetNormalNudgeFactor
(too large values cause bumps when sliding on a flat ground).
It is not recommended to change the offset after the creation of the character controller.