A 2D Metroidvania camera has a harder job than it looks. The player spends the whole game moving vertically as well as horizontally, and every one of those transitions is a chance to make someone motion sick or hide the thing they need to see.
Y-axis damping
The core problem: follow the player’s vertical position too tightly and long falls become nauseating; damp it too much and the player outruns the frame on the way down.
The camera damps the Y axis dynamically rather than at a fixed rate — loose during ordinary jumps, so small hops don’t drag the whole frame around, and tightening as vertical velocity sustains, so a long fall keeps the player in view without whipping.
Panning on triggers
Designers need to be able to say “when the player enters this room, look left” — an approach ledge, a hidden route, a boss entrance. Trigger volumes drive customisable pan offsets, so a space can bias the framing without any bespoke code per room.
Directional swaps
When the player reverses, the camera leads them the other way. Done naively this snaps, or worse, oscillates when the player is hovering near a turn. The swap is blended and hysteresis-damped so a player jittering left and right doesn’t shake the frame apart.
What I’d do differently
The damping curve was hand-tuned against how the game felt at the time. Given longer I’d have exposed it as an authored curve per zone rather than a global setting — some rooms wanted a much tighter follow than the tuning that suited open areas.