weapon bobbing

HI GUYS

I saw a few videos about some games where the child object doesn’t move exactly at the same time as it’s Main Object. So there’s kind of delay or time-shift. I tried this with animations and a few other things… but is there a code on how to delay the child objects… Here are some games or videos:

so how can I do weapon bobbing.