I am using the first person controller prefab (the pill shaped guy) with a slightly modified script. I can jump up mountains, he doesn't slide down really steep slopes. why not? and how can I get him to? or on the other hand how can I get him to walk up any slope without having to jump? in short, how can I be in charge of the slopes my player is able to navigate?
To get the player to be able to climb steeper slopes without jumping, you just have to change the slopeLimit parameter to an angle of your choosing.
To get it to slide down slopes of certain angles, you have to manually implement that in you character controller script. In your OnControllerColliderHit function, check for collision with the ground, and move the character controller sideways based on the direction and angle of the normal received.
you can change the slope variable but remember that limiting the slope allows you to use mountains and steep slopes to restrict players from getting past a certain point and thus they fall off the map.
Hi,
I think the question is how do you get the slope angle so that the sliding can be implemented.
Just settting the slopeLimit does no action of sliding, just limits the character "not to go up any further".
This is what Im trying to find out as well, but Character Controller lets you retreive this variable?
You can get the ground normal by implementing OnControllerColliderHit in any component that lives on the same gameObject as the Character Controller