Hi all,
I’m doing a racing game with clutch implementation. I’m trying to emulate the engine increasing RPM freely without attaching to the transmission when pressing clutch and when in Neutral. However, with my current formula, I cannot do that:
To get RPM, I based on the wheelCollider.rpm
engineRPM = wheelCollider.rpm * gearRatio * differential * 60 / 2 * Mathf.PI
maxTorque = LookupTorqueAnimationCurve(engineRPM)
engineTorque = throttle * maxTorque
wheelCollider.motorTorque = engineTorque * gearRatio * differential * clutch
I tried simulating the wheel not receiving torque by adding clutch input when transferring engineTorque to wheelCollider.motorTorque, but the engineRPM would drop as the wheelCollider.rpm drops.
I’ve been looking at calculating engine’s own RPM with engine Inertia and acceleration, but have no idea how to implement into this. Let’s assume that I know the engine’s inertia and the wheel’s inertia, where should I go next? Or what should I change in my formula for the clutch implementation to work?
Thank you guys very much