- Home /
Other
Better RPM??
Hello! I am designing the technical part of my car and I have a RPM formula that does not convince me, it is the following:
//RPM Formula
EngineRPM = (WheelTI.rpm + WheelTD.rpm) * GearRatio[CurrentGear];
ShiftGears();
//Torque Formula
WheelTI.motorTorque = (EngineTorque / GearRatio[CurrentGear]) / Gear * Input.GetAxis("Vertical");
WheelTD.motorTorque = (EngineTorque / GearRatio[CurrentGear]) / Gear * Input.GetAxis("Vertical");
//Shifting Formula
//(is ubicated in ShiftGears function of the script, under RPM Formula)
int AppropriateGear = CurrentGear;
if ( EngineRPM >= MaxEngineRPM ) {
for ( int i= 0; i < GearRatio.Length; i ++ ) {
if ((WheelTI.rpm + WheelTD.rpm) * GearRatio[i] < MaxEngineRPM ) {
AppropriateGear = i;
break;
}
}
CurrentGear = AppropriateGear;
}
My goal is to achieve something like this (second 0:15): https://www.youtube.com/watch?v=mPdyegq5M4M&list=PLpBVLiNEBD_XZehekMwa76qsfK2PfjDiM∈dex=34
For example, in the video the car, when it skids and accelerates, does not make the changes, but reaches the maximum speed (depending on the torque applied), or when it accelerates in the first gear when it is braked.
But I don't know what formula to use to make it work that way, any ideas?
Thank you for reading!
Follow this Question
Related Questions
How to make traction control for car? 1 Answer
Shift gear with own RPM? Help please! 0 Answers
transmission clutch help! 1 Answer
Destroyed car styled need for speed? 0 Answers
how to rotate car to camera direction using wheel colliders. 1 Answer