Sorry for offtop, this is was previously.
LFS number plate (bug)
LFS number plate (bug)
// assuming we run on 100Hz
// variables description
const float clutch_max_speed = 0.25 / 100;
float clutch; // the value you will put in the physics calculation
float user_input_clutch; // the value you get from your input system every frame
// now follows the code you run every frame
{
float delta = user_input_clutch - clutch;
if (abs(delta) > clutch_max_speed) {
clutch += sign(delta) * clutch_max_speed;
} else {
clutch = user_input_clutch;
}
}