How to prevent the shaking of a camera, when attached to the character?

Hi all, I have a player which is moving with keyboard commands. I do this by using a C# script which also activates the animations of my player. I know this is a duplicate question, however I didn’t find much.


My question is how to prevent the “shaking” of the camera ? (See GIF)

Don’t attach it to the character. Either make the camera follow the character by script, or use Cinemachine.