How Can I Linear Interpolate (Lerp) in Local Space?

I’m trying to smooth the motion of my camera by using Lerp (I had previously been using Transform.translate). This has worked for panning my camera left and right, but I have my camera pitched downward at 45 degrees and I would like my scroll wheel to move the camera in Local Z (ie, along the camera view path).

Lerp cannot take Space.Self as an argument, so how can I achieve this?

(If possible a C# solution would be appreciated, but I can translate a JS answer to C#)

Solved.

You can get the local vector by using transform.InverseTransformDirection().

Vector3 relativeMoveVector = transform.InverseTransformDirection(moveVector);
myCamera.position = Vector3.Lerp(myCamera.position, myCamera.position + relativeMoveVector, Time.deltaTime * smoothingFactor);

Keep in mind that lerp is a really straight forward function. It’s “how much i do take from a, and how much do I take from b”. Thus, the space you’re working on is irrelevant. What you mean is a lerp between a position and that position minus a certain distance along it’s forward vector (here is the space.self). It’s up to you to find that a and that b. Then the wheel will control the t in Lerp(a, b, t).