- Home /
[Character controller] run faster on slopes and jetpack
i have a character controller and a script to control it, i have a terrain with hills and i want to make the character run on downhills, and then jump higher on uphills, and then, active jetpack...Like in this video
thanks in advance guys
If the character is grounded and his position.y decreases between frames, then he is apparently going downhill (or descending a ladder). Increase the horizontal velocity in this case. A Jetpack functionality would start with increasing the y velocity on buton presses, I would imagine, and possible disabling gravity effects.
do you know how to make it in script???.. please bro, i need help
With what do you need help? First of all, you didn't say what kind of CharacterController you use. Is it the one from Standard Assets, or a custom one? either way, you should take a look at how it works and you will probably see that it has a grounded bool variable. You also know that each GameObject has a Transform component, and that transform.position is a Vector3 variable that consists of x,y and z. So you also know that you can read the y position. A CC also has a velocity which can be set according the movement mode of the character (running, walking etc.) as well as the gravity.
So, since you know (you could know, since it's all included in the CC) all these things, what is your question? :)
Answer by PaulPer_TF2 · May 09, 2016 at 07:22 PM
One thing to test is try applying different material types to the hills. Slippery could work on the downhill and bouncy might work on the uphill to make them jump higher.
... it sounds great... but... im using a unity terrain... so,how i can do what you say ?
lol.... i think this cant work... because all the downhills are a uphill at the same time :v so... the problem here is how to check if the player is going downhill, and when is going uphill :(
Your answer
![](https://koobas.hobune.stream/wayback/20220612080118im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Character Controller Slope Limit on Terrain 0 Answers
3rd person character controller walking down hill 1 Answer
CharecterController.Move() ignores parents movement 0 Answers
CharacterController slower on slopes (up and down) 1 Answer
Character floating after walking up higher terrain/object 1 Answer