Car Engine Unity/Fmod

I have car sounds in an Fmod project with and Rpm parameter.

Im using 'Input.GetKe’y to increase the speed of my object and also the RPM parameter in Fmod.

However when the sound is going up it is clicking like crazy. Is there a way to get numbers to rise more smoothly in Unity so that they can affect audio parameters in Fmod more smoothly?

Any suggestions would be greatly appreciated:)

Tks

void FixedUpdate()
    {
        if (Input.GetKey(KeyCode.W)&&speed < 50&&RPMAmount<3000)

        {
            speed+=1;
            print (speed);
            CarEngineEvent.start();
            RPM.setValue (RPMAmount);
            RPMAmount += 100f;
        }

        else if(Input.GetKeyUp(KeyCode.W))

        {
            speed-=10;
            print (speed);
            CarEngineEvent.start();
            RPM.setValue (RPMAmount);
            RPMAmount-=100;
           
        }

Here is code involved.

Could you try using a simple averaging filter? It would work a little like a low pass filter. This should smoothen the values out.

I figured this last night. I moved the CarEngineEvent.start(); into the Start function. It was making the Event start with each button push. Theres also a Seek Speed Knob in Fmod that is related to the Parameter Values that can be changed to help with smoothing. So its better at least :slight_smile:

Nice one. :slight_smile: