How to make my gun bob up and down whilst running

hey everyone. I am a complete newbie when it comes to Unity3D.

I have only just figured out how to attatch a gun to the fp camera.

nowwwwwww. When i press “W” i move forward but my gun is still and it sucks,it looks really bad!

can anyone tell me how to make it bob up and down?

thanks in advance.

If i were to do this, I would have an animation for the gun bobbing up and down done up as an animation in unity, and to play the animation when the W key is pressed down.

Hope this helps!