Dynamic movement of camera

Hello. I have a spaceship with a camera as a child. When I move the spaceship around and rotate it, I want the camera to be dynamic and respond to these movements of the ship.

The camera is a cockpit camera, and so the camera needs to have dynamic movement for hard turns/rotations, much like someone’s head when in a fighter jet/sports car.

For example, If I pitch up, I would want to camera to move down a bit relative to the ship. If I accelerate, the camera goes back a bit, etc.

I think this is done by moving the camera a few frames late, but I’m not entirely sure how to go about doing that.

Any help?

There’s a SmoothFollow.js camera script you could use, included in the Standard Assets package. But don’t make the camera a child of the target object, for it to work, I think. Just attach the script to the camera, and assign a target in the inspector.

Additionally you can check out the Unify wiki for other great resources, and script examples. http://wiki.unity3d.com/index.php/Scripts (camera scripts are in Controllers tab)