- Home /
 
 
               Question by 
               PersonMon · Nov 25, 2020 at 12:35 AM · 
                c#positionjumpingcharacter controller  
              
 
              how to keep mid air velocity using character controller?
I followed Brackeys's tutorial on a first person controller (with some modifications) and wanted to make it so that when you jumped, you couldn't change your trajectory and would go in the direction you were running.
 if (controller.isGrounded)
 {
             move = (transform.right * x) + (transform.forward * z);
 }
 else
 {
  move = (transform.right * controller.velocity.x) + (transform.forward * controller.velocity.z);
 }
 controller.Move(move * speed * Time.deltaTime);
 
               This was my best attempt at it and it completely bugged out. you wouldn't go the right direction, there was lots of jittering, and jumping just sent you flying. 
(like pressing it once sent you to 1.288735e+18, 0, 1.419365e+19) 
I have no idea what to do.
               Comment
              
 
               
              Your answer
 
             Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Shift BHOP in Character Controller 0 Answers
,How to disable autojumping when holding spacebar? 4 Answers
Multiple Cars not working 1 Answer