Hello all,
I’ve been going over the code for the standard assets and specifically the jet. I cannot for the life of me seem to find where it is automatically setting the throttle to max. There is currently no real way to speed up or slow down, and you can only stop the aircraft by extending the air brake. Anybody able to find where the auto-full throttle part of the code is? Thanks for the help!
AeroplaneUserControl2Axis.cs
Line 32, 33 ?
// auto throttle up, or down if braking.
float throttle = airBrakes ? -1 : 1;
Or you could just use AeroplaneUserControl4Axis.cs
Use the Axis scripts to access data throttle inside Aeroplane Controller. If you want change the throttle system, need to change on Aeroplane Controller in the function called Move. Apply the changes on Vector3 and Quaternion on Fixed Update section. Use the Axis script as a panel from motor system. Inside Axis script you will see a function m_Aeroplane.Move that load in the parameters all data from input to do controller to work. Change the values before it reach the parameters. On 2 Axis standard script you can see that there have a auto throttle coded. just use // and use another method. An good example is on 4 Axis standard asset script. The velocity, torque and engine power, on Aeroplane Controller, uses some Clamp to limit the speed, SmoothDamp to smooth the movement of Quaternions and Vector3 values and some Lerp and Slerp to other movements.