help implementing the clutch in a driving simulator

hi all, im new to unity and im trying to develop a driving simulator. for now i succeded in implementing the gearbox, the rev counter and the tachometer. the vehicle physic is good, but now im stuck cause i cant implement the clutch. someone has some ideas? it should be a torque transfer, so i think i have to use a force and “transfer” this torque to the wheels in a progressive way.

someone can help me?
thanks

Hi, welcome to the forum!

A clutch varies the amount of engine power transmitted between complete engagement (ie, 100% of the power) and disengagement (no power transmitted). Given that the engine’s “power” at any time will be expressed as a number, you can model a clutch using Mathf.Lerp. The parameters to this function will be zero, the current engine output and an interpolation parameter between zero and one (corresponding to complete disengagement and engagement, respectively).

However, the main difficulty in implementing a clutch for a game is likely to be the controls for the player. A simple engage/release clutch is easy enough to do with a keystroke, but a variable contact clutch might be more difficult (unless you have a particular piece of input hardware in mind?)

hi andeeee,
your advice seems to be interesting, but i dont know how to use it to implement the “neutral” state of the gearbox. in that case when you thorttle revs goes up but the car stand still; when you relaese the clutch the torque is trasferred to the wheels gradually according to the revs number in that moment.

Could you just use a gear ratio of zero for neutral (or does that not make sense in your implementation)?

no i cant do in that way… gear ratio is used to calculate the engine RPM (revs per minute):

TransmissionRatio = gearboxRatio

``````*diffRatio;
EngineRPM = (FrontLeftWheel.rpm + FrontRightWheel.rpm)/2 * TransmissionRatio ;

I think that the only way is to put a rigidbody (with a motor torque) joined and in contact with another (that act as the receiving part of the clutch). the friction of this last rigidody must be zero when the clutch is completely engaged, and must change (increase) during the release of the clutch in order to simulate the torque transfer.