- Home /
first person controller doesn't slide down slopes
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?
Answer by jonas-echterhoff · Oct 11, 2010 at 10:17 AM
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.
where is the "slopelimit parameter"? is that the'slope speed multi'?
Answer by DannyJax.du · Oct 12, 2010 at 02:59 AM
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.
Answer by Caps · Dec 10, 2010 at 03:11 PM
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?
Answer by KainAsylum · Jul 08, 2014 at 08:55 PM
You can get the ground normal by implementing OnControllerColliderHit in any component that lives on the same gameObject as the Character Controller
Your answer
Follow this Question
Related Questions
Limit Diagonal Speed 2 Answers
Why is my CharacterController slowing on hills? 3 Answers
Grounded check not working on sloped ground. 1 Answer
FPS Walker Script Location in the latest Unity version 2 Answers