Hi all, I’m trying to set up a game in which I can control a helicopter using similar controls to what is used in games like Battlefield. I am using the Input.GetAxis (Vertical) for forwards and backwards movement using code such as:
forward_force = Input.GetAxis ("Vertical") //mouse x axis
sideways_force = Input.GetAxis ("Horizontal") //mouse y
rigidbody.AddTorque (transform.right * forward_force); //tilt chopper forwards /back
rigidbody.AddForce( transform_forward*forward_force); //drive chopper forward/back
Problem is, the mouse values are all over the place, they will read all sorts of values depending on how fast I move the mouse. Then if the mouse is not moved, they return to 0, resulting in no forward momentum
Is there a method of somehow keeping the mouse value until the next move of the mouse ?
I have also tried Mouse X and Mouse Y, but again, the values are jumpy
Ideally, I’m thinking as the chopper tilts forward due to torque , i can set a vector of appropriate force to move it forward based on the local transform rotation or similar, unless anyone can offer a better solution