How-To: Set Up a 2D Side-Scroller Camera
Goal: a fixed-axis 2D / 2.5D platformer camera that frames the pawn within a flat plane, holds still while they move inside a deadzone, and leads them in the direction they are running.
UCrimsonCameraComponent on your pawn and ACrimsonPlayerCameraManager on your controller.1. Create a side-scroller mode
Make a Blueprint subclass of UCrimsonCameraMode_SideScroller. Like the top-down mode it owns the view rotation outright and ignores look input, so the camera never orbits.
2. Choose the plane
View Axis Yaw is the yaw the camera looks along. The gameplay plane is perpendicular to it, so the yaw you pick decides which world axis your level runs along.
View Axis Yaw | Camera sits at | Level runs along | Height on |
|---|---|---|---|
0 (default) | -X, looking toward +X | Y | Z |
90 | -Y, looking toward +Y | X | Z |
180 | +X, looking toward -X | Y (mirrored) | Z |
View Pitch tilts the fixed view downward. Leave it at 0 for a pure side-on look; a few degrees adds depth to a 2.5D scene. The deadzone and framing offset are measured along the view's own axes, so they stay meaningful once you tilt.
Derive Axis From Movement Plane and the camera reads the constraint normal every frame - the camera axis then cannot drift out of sync with the plane the pawn is actually locked to. It falls back to View Axis Yaw when the pawn has no movement component or is not constrained. Get Resolved View Axis Yaw returns whichever is in use.3. Frame the target
| Setting | Purpose |
|---|---|
Camera Distance | How far back (cm) the camera sits along the view axis. |
Framing Offset | Constant offset of the framed point within the screen plane: X moves it right, Y moves it up. A negative Y is the usual choice - it puts the character in the lower third with headroom above. |
Use Zoom | On by default: the camera component's shared zoom distance (Add Zoom Distance) is added to Camera Distance, so the same player zoom control works here as in third person. Untick for a framing the player cannot change. |
4. Tune the deadzone and the follow
This is what separates a platformer camera from a plain follow: the camera holds completely still while the target moves inside the deadzone box, and then chases only the part of the offset that has escaped it - horizontally and vertically at their own speeds.
| Setting | Start with | Why |
|---|---|---|
Deadzone Half Height | Generous (100-150) | A jump arc should not heave the whole screen up and down. |
Deadzone Half Width | Tight (40-80) | Running should track immediately; only small steps should be absorbed. |
Follow Speed Vertical | Slower (3-5) | Landing on a new platform should settle, not snap. |
Follow Speed Horizontal | Faster (7-10) | The camera should keep up with a sprint. 0 on either axis means snap (no lag at all). |
Camera Distance off the target's plane, so a pawn that is not perfectly plane-constrained can never pull the camera into - or through - the geometry behind it.5. Add look-ahead
Look-ahead biases the framing toward where the target is heading, so the player sees what they are running into rather than what they just left. Look Ahead Time is the slice of the target's velocity to lead by, Look Ahead Max Distance caps it so a sprint or a long fall can never push them off screen, and Look Ahead Interp Speed makes a change of direction slide the framing across instead of snapping it.
6. Push it
Snap To Target on the mode instance (Get Camera Mode Instance or Get Active Camera Mode -> cast) after a teleport or a level-section change. It re-frames the target next frame instead of sweeping the camera across the world to catch up. Activation does this for you automatically.7. Turn the body with movement
Set the mode's Declared Pawn Facing (in the Facing category) to OrientToMovement for classic side-scroller locomotion. As with every shipped mode it is Unchanged by default, so the plugin writes no movement flag until you opt in - see How-To: Face the Lock-On Target for the full resolution order.
See also
- How-To: Switch Camera Modes - drop into (and back out of) the side-scroller view for a section.
- How-To: Occlusion Fade - fade geometry that ends up between the camera and the pawn; this mode runs no penetration avoidance of its own.
- Concept: The Mode Stack - how this mode blends in over its Blend Time.