What is camera bobbing in games and how is it implemented?

I've heard the term "camera bobbing" in FPS and third-person games. What exactly is it, and how do developers typically implement it? Is it purely cosmetic or does it affect gameplay? Looking for both a conceptual explanation and any code examples.
 
Camera bobbing is a subtle up-and-down or side-to-side camera movement in games that simulates a character’s walking or running motion.

It’s implemented by applying small, timed position/rotation changes (often sine wave animations) to the camera based on movement speed to make motion feel more realistic.
 
Camera bobbing in video games refers to an effect in which the camera moves vertically or horizontally when the character is walking or running.
The effect can be programmed by superimposing the camera position with minor oscillations depending on factors such as player velocity, running cycle, or animation. The amplitude and frequency of these oscillations can be modified to reflect the intensity of the movements.
 
Back
Top