How to achieve smooth movement using the scroll wheel?

Hey, I’m working on a script and for the life of me can’t figure out how to solve this.

Basically, what is supposed to happen is that whenever the player scrolls using the mouse wheel, the player moves forwards or backward. The part I can’t figure out though, is how to do this smoothly.

I’ve got the basic movement down for the player, but even if I use Lerp functions, the movement is still jittery.
Can anyone help with this?
At the moment, I’m just moving the character using transform.position += …

Many thanks!

I figured it out, for anyone who might stumble upon this question.

I used a workaround, namely to have a separate object that I apply the jittery movement to, then use Vector3.Lerp(transform.position, secondobject.transform.position, 0.1f) to smoothly move between the two positions

I hope this helps someone!

Cheers,

Kjip