- Home /
Character Controller Lands on Slopes
My character controller will land on sloped walls (60 degrees) and stop there. He cannot walk up them, but he'll happily slide along parallel to the wall. That wall is too steep for him to stand on, and I need him to slide down it.
I am managing gravity myself and simply calling CharacterController.Move() with my accumulated velocity. I have verified that my velocity is continuing to grow in the -Y direction. Yet the character will NOT slide down the slope.
In fact, it seems to be that if my CharacterController makes contact with any surface with a normal facing in the +Y direction, it will cancel all movement in the -Y direction. Thus he can land on a steep slope.
I have a pseudo work-around that almost works. I detect the contact myself using OnControllerColliderHit() and apply enough X and Z motion to make him slide parallel to the wall. Unfortunately, this causes him to miss the collision on the following frame (since he's now travelling parallel to the wall).
I'm now about to resort to dropping the CharacterController altogether and attempting to roll my own controls out of a Kinematic RigidBody. Is that really what I have to do here?
There's got to be a better way.
Answer by Volcanic-Penguin · Nov 15, 2011 at 04:51 PM
Since you're not mentioning it, I have to ask, are you aware that the character controller component has a variable calls slope limit?
I am aware, and I was quite disappointed that it didn't help to change that value. One of the most obvious things, so I tried it first.
Answer by Volcanic-Penguin · Nov 15, 2011 at 11:56 PM
There's an answer here that might help, I'll have to try this too:
http://unity3d.qatohost.com/questions/29777/first-person-controller-doesnt-slide-down-slopes.html