Is there an easy way to make my camera lag behind the vehicle?

I need my camera attached to the players vehicle lag behind and eventually catch up with it when it moves. Until this point I implemented some arbitrary camera positioning and rotations via calculations based on the mouse position (the mouse position controls the direction of the ship).

I just need to give the camera some inertia and be affected by changes in the ship’s path.

Whats the best way to do this?

My vehicle is controlled by some code and cannot be controlled by physics, it does not use the physics engine.

You can use Vector3.Lerp to set the position and make the camera follow some GameObject. Create an empty GameObject child of the car and change his position to the place where de camera would be if the car was stopped. After this create a script for the camera, create a transform variable that will hold the transform of the empty GameObject and make the lerp of the camera.postion to the empty GameObject position.