- Home /
Third person controller in Flight
Quick question - what values in unity's third person controller do I need to change to allow the character to keep ascending (hold jump button) and to allow the character to rotated when in air?
Thanks
Answer by A-man tuna · May 03, 2014 at 06:17 AM
well i'm not sure about the jump button but what worked for me was in the apply gravity function of the third person controller i added this script
if(Input.GetKeyDown(KeyCode.F))
{
gravity = -20;
}
if(Input.GetKeyUp(KeyCode.F))
{
gravity = 20;
}
this will allow you to ascend/fly whilst the F key is held down and will allow you to descend/go back to the ground when you are not pressing the F button. Hope this helped.
good luck
Your answer
![](https://koobas.hobune.stream/wayback/20220613084910im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
how can I make a character fly when holding down the jump button? 1 Answer
How to reverse this code 0 Answers
What's wrong with my script? 1 Answer
Help combining 2 scripts 0 Answers
Floating player 1 Answer