Home▸Game Development▸Third-Person Spring-Arm Camera: Top View, Probe Hit and Arm Length Over Time (2D)

Third-Person Spring-Arm Camera: Top View, Probe Hit and Arm Length Over Time (2D)

Top view of the courtyard with the character, the ideal and the actual camera positions, the probe hit point, and a plot of the arm length, the target length and the clearance from the walls over one lap.

Game Development2DModerate60 FPS📱 Mobile-adapted🟠 Blender⇄ 3D version
Third-Person Spring-Arm Camera: Top View, Probe Hit and Arm Length Over Time (2D) ↗ Open standalone

A game camera on a spring arm follows a walking character round a courtyard of pillars and walls. Every frame a probe ray runs from the character's head towards the ideal camera position; if a wall is in the way the arm is shortened so the lens stays clear of it, and when the path frees up the arm recovers with a critically damped spring that never overshoots. Change the arm length, probe radius, recovery speed, pitch, walking radius and speed, and the yaw offset, and compare instant against smoothed pull-in. A Blender-built courtyard with numerical checks.

⚙ Under the hood

Top view of the courtyard with the character, the ideal and the actual camera positions, the probe hit point, and a plot of the arm length, the target length and the clearance from the walls over one lap.

Spring Arm CameraThird-Person CameraCamera CollisionCritically Damped SpringRay-Box IntersectionGame CameraGame Development

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)