Weapon sway while moving

Hello. I am working on a small FPS project right now and I have a problem. I want to make a weapon sway effect with timelines like in this video link text . Any ideas on how to do this? Thank you for your time.

You need a skeleton, with an animated bone that can have a socket attached to it. Orient the socket and attach the weapon to it and set up the animation to play while you’re moving.

I have only a capsule component with my weapon blueprint attached to it. It is actually possible to do this without animation.The problem is that I dont know how to correctly connect and execute the timeline.
Anyway , thanks for your fast reply.