0 votes
by
How to set the gearbox to be able to change the gears on lower / higher, and getting rpm relative to particular gears?

1 Answer

0 votes
by
 
Best answer

Vehicles in Edy's Vehicle Physics don't simulate engine or gearbox. Currently "gear" and "rpm" are calculated in the VehicleAudio script for the sole purpose of playing the engine audio.

You can simulate a manual gearbox by writing a script that changes these properties of the Vehicle Controller component in runtime:

VehicleController.maxSpeedForward (m/s)
VehicleController.maxDriveForce (N)

Your script could hold an array of pairs maxSpeedForward-maxDriveForce for each gear. Lower gears have low max speed but high force. Higher gears have high max speed but low force. You could configure each gear independently in the Editor by modifying these values in runtime, then noting the best values for each gear and finally configure them in your script.

The ratio "current speed" / maxSpeedForward can be multiplied by a configured maximum engine rpm to get the current engine rpm.

...