FPS Head bob

Hi. I want my player to head bob when walking/running. The speed of this is determined by the character controllers velocity. I’ve googled but found nothing. Can someone help me? Thanks.

Put an extra GameObject in the hierarchy above the camera, then drive that object’s vertical offset with a script that bobs it gently, probably using some looping animation curve. You can use an AnimationCurve property and edit curves on your script directly in the editor until you are happy with the bobbing motion. To make the motion increase with speed, advance the notion of “time” in your animation curve lookup based on your forward speed, probably adjusted by some constant multiplier.