camera shakes

Hi,

I have the camera following the player in a side scrolling type game.
I can do this BUT the camera shakes when I move the player.
I dont have any other camera script attached other than default ‘camera script’.

I include this below code into another script attached to the camera and player is the player object dragged onto the inspector

public GameObject player;

transform.position = new Vector3(player.transform.position.x, player.transform.position.y+2, player.transform.position.z-8);

How do I stop the shaking? Looks like an embarrassing newbie question which I am still searching google for an answer.

I placed the camera as a child of the player , got rid of the script and it works.
Maybe you cant have the camera follow the player object and not be a child of the camera.