I have a scene where my Character Controller must move between boxes of varying heights, seperated by small staircases. In order to do this, I have used a tilted box collider for the staircase collider, which the character is able to walk up like a ramp. As I have set the Character Controller slope speed multiplier to a consistent value of 1.0, the character is able to walk up staircases of varying gradients at a consistent velocity.
However, when the character reaches the top of a staircase and begins to walk again on a horizontal plane, their movement speed drops dramatically, seemingly inversely proportionally to the steepness of the staircase collider. Their speed snaps back to normal after moving a seemingly random distance. I am using Unity 4.1.2, and after altering a number of Character Controller variables and experimenting with different kinds of colliders I still can’t seem to resolve this issue.
Most likely the character is encountering a steep normal at the top of the slope. When this happens, the velocity dramatically decreases. The fix is modifying the CharacterMotor.js script, specifically the function AdjustGroundVelocityToNormal here (line 364 in my version):
You might prefer to tweak the AdjustGroundVelocityToNormal function not to have so much influence in your character’s velocity.
EDIT: You can safely void the CharacterMotor.AdjustGroundVelocityToNormal function and tweak the velocity with the slope using the curve CharacterMotor.slopeSpeedMultiplier. It’s a much more convenient way to fine tune the velocity of the character with the slope of the ground.