Inertia/Smoothing Advice

I’m relatively new to Unity and the languages as well, and have been having some issue trying to figure out how to get some form of smoothing applied to the following:

transform.Translate(  Vector3.right * -Input.GetAxis( "Mouse X" ) * panSpeed );
transform.Translate(  Vector3.forward * -Input.GetAxis( "Mouse Y" ) * panSpeed );

I’ve dug around online and here and in the scripting manuals, but everything I’ve found has either confused me more or applies to a completely different style of movement. I assume I need to cache the current transform, then apply the Translate and use a Lerp or some other form of smoothing between the two values, I’m just sort of at a loss as to how to even begin to start.

Any tips, advice, or pseudo-code or a point in the proper direction would be greatly appreciated. I apologize if this is the wrong way of doing this, but I’m just frustrated and would rather not waste more time searching for a solution. Thanks in advance.

MouseX and MouseY are delta values, so they reflect the direct movement during the lastframe and the current. It’s difficult to smooth such values directly. It’s easier to use an empty target object with your script above and let the actual gameobject follow that target object. For that you could use the SmoothFollow script from the standard assets or do your own smooth follow.