Skip to main content
Version: Next (dev)

Common Camera Setups

This page walks through complete camera setups for common kinds of games. Each one lists the components you need, where they go and the property values that give the effect, so you can build it from scratch or use it as a starting point. Every property is described in full on the reference pages: Views, Director, Modifiers and Framing.

All setups start from the same base, described once below. Input action names such as Aim or LockOn must exist in the project's input action map and be bound to keys and buttons.

SetupGood for
The base setupEvery setup on this page.
Over-the-shoulder action cameraThird-person shooters and action games.
Exploration cameraAdventure and platforming games where the player mostly moves.
First-person shooterFirst-person games with aiming, leaning and weapon feedback.
Melee lock-onAction games with bosses and duels.
Fixed camera per roomHorror and puzzle games with authored camera angles.
Side-on rail cameraCorridors, chases and side-scrolling sections.
Top-down cameraStrategy, management and twin-stick games.
Scripted shot and dialogueStory beats, reveals and conversations.
Explosions and shaking areasAny game.

The base setup​

The base setup is one Camera Director next to the scene's Main View camera, and one player view on the character. Build it once, then add the pieces each setup lists.

  1. Add the Gameplay Cameras package to the project in the package manager.
  2. Create an object named Camera. Add a Camera component with Usage Hint Main View, then a Camera Director on the same object.
  3. Make sure the player character has a plInputComponent that uses the project's input action map. Views and modifiers read their actions through it.
  4. Under the character, create a child object for the player view and add the view the setup asks for.
  5. Set the director's DefaultView to that child object.
  6. Play, and run Cameras.Debug 1 in the console. The player view should be the only request, at priority 10.
note

Modifiers can go in the director's Modifiers list, where they apply to every view, or in a view's own list, where they apply only while that view is showing. Put effects the player always feels, such as shake, on the director. Put effects that belong to one view, such as head bob on a first-person view, on that view.

Over-the-shoulder action camera​

A close third-person camera offset to one side, so the character does not block the crosshair. The player can swap shoulders, aiming pulls the camera in and narrows the view, and shots kick the aim up.

WhereComponent or modifierSettings
Player viewThird Person ViewTargetOffsetLow (0, 0, 1.3), TargetOffsetHigh (0, 0, 1.6), MaxDistance 2.2, ShoulderOffset 0.5, ShoulderSwapAction SwapShoulder, and LookInput → LookAction set to the look action.
DirectorDampingDefaults. Smooths the small jitter of a moving character.
DirectorZoomAction Aim, FovScale 0.65, ArmPull 0.45, LookScale 0.5.
DirectorRecoilDefaults.
DirectorShakeDefaults, Name Shake.
  1. Build the base setup with a Third Person View and the settings above.
  2. Add the modifiers to the director in the order shown. Order matters within a stage: with Damping first, it smooths the view's movement but not the recoil kick that follows.
  3. From the weapon script, call AddRecoil(2.5, 0.3) on the director for each shot. Vary the yaw a little per shot if you want the aim to wander.
  4. Play. Hold the aim button: the camera moves in and the field of view narrows over 0.15 seconds. Press the swap action to move the camera to the other shoulder.

Tuning​

  • For a tighter feel when aiming, lower FovScale to 0.5. To slow the look speed less while aiming, raise LookScale.
  • To center the character when not aiming, set ShoulderOffset to 0 and change it from script while aiming. Changes ease in.

Exploration camera​

A relaxed third-person camera for a game where the player spends most of the time moving. The character can drift inside a dead zone before the camera follows, the camera swings back behind the character when the player stops steering, and it slowly turns toward landmarks nearby.

WhereComponent or modifierSettings
Player viewThird Person ViewMaxDistance 4.5, AutoRecenter on, RecenterDelay 2.5 s, LookAhead 1.5, PositionLag 0.1 s.
DirectorCompositionSoloPoint Leading Room, DeadZone (0.12, 0.10), SoftZone 0.55.
DirectorLook HintSpeed 6°, IdleTime 2 s.
Each landmarkCamera Point Of InterestActivationRadius to taste.
  1. Build the base setup with a Third Person View and the settings above.
  2. Add Composition and Look Hint to the director's Modifiers list.
  3. Add a Camera Point Of Interest to each landmark the camera should drift toward.
  4. Play and run around. With Leading Room, the character sits on the third of the screen behind its direction of travel, leaving room ahead. Stop steering near a landmark and the camera turns toward it.

Tuning​

  • Use SoloPoint Center for a classic centered character.
  • A bigger DeadZone makes the camera calmer, and a smaller one follows more tightly.
  • While the player steers, Composition follows the camera's new aim instead of pulling the character back to its point. It frames the character again once steering stops.

First-person shooter​

A first-person camera at the character's eyes, with head bob while walking, a dip on landing, leaning around corners, aim-down-sights zoom, a wider view while sprinting, and recoil.

WhereComponent or modifierSettings
Player view, under the head objectFirst Person ViewLookInput set up for pitch, NearPlane 0.05, MaxPitch 85°.
Player viewHead BobDefaults, Name HeadBob.
Player viewLandingDefaults.
Player viewLeanLeanLeftAction LeanLeft, LeanRightAction LeanRight, MaxRoll 10°, SideOffset 0.35, CollisionLayer the layer walls are on.
DirectorZoomAction Aim, FovScale 0.6.
DirectorFOV KickSpeedThreshold 5, FullSpeed 8, MaxKick 8.
DirectorRecoilDefaults.
DirectorShakeDefaults.
DirectorFocusTarget Crosshair. Only needed with depth of field.
  1. Follow Setting up a first-person camera on a character with a head object.
  2. Add Head Bob, Landing and Lean to the view's own Modifiers list.
  3. Add Zoom, FOV Kick, Recoil, Shake and Focus to the director's list, in that order.
  4. From the weapon script, call AddRecoil(1.5, 0) on the director for each shot.
  5. Play. Walk to see the head bob and jump off a ledge to see the landing dip. Lean next to a wall: the camera tilts but stops moving sideways before it reaches the wall.

Tuning​

  • Some players feel unwell with head bob. Offer a slider in the options menu and pass its value to SetModifierWeight("HeadBob", value) on the director while the first-person view is showing.
  • Head Bob and Landing need a character controller on the subject, so they know when it is in the air. See Landing.
  • For VR, leave AllowInXR off on rotational effects such as Shake and Lean.

Melee lock-on​

The player presses a button to lock onto an enemy. The camera then keeps the player lower left and the enemy center right, and another button switches to the next enemy.

WhereComponent or modifierSettings
Player viewThird Person ViewMaxDistance 4.
DirectorCompositionDefaults. Lock-On frames through it.
DirectorLock-OnAction LockOn, SwitchAction SwitchTarget, MaxDistance 20, TargetOffset (0, 0, 1.4).
Each enemyTagThe tag LockOnTarget on an object with a mesh or other rendered component.
  1. Build the base setup with a Third Person View.
  2. Add Composition, then Lock-On, to the director's Modifiers list.
  3. Give each enemy prefab the LockOnTarget tag.
  4. Play, face an enemy and press the lock-on button. The enemy nearest the center of the screen is picked. Press the button again to release, or move more than 24 meters away (1.2 × MaxDistance).

Tuning​

  • For a large boss, raise TargetOffset to its chest or head height.
  • To lock only while the button is held, turn Toggle off.
  • When the locked enemy's object is deleted, the modifier picks the next target, or releases the lock when there is none.

Fixed camera per room​

Each room has its own authored camera angle. Walking into a room cuts or blends to its camera, which turns to keep the player in view. Outside every room the player's own camera returns.

WhereComponent or modifierSettings
Player viewThird Person ViewAny. Used between rooms.
An object per room, at the camera positionFixed ViewTarget the player, TargetOffset (0, 0, 1.2), TrackingSmoothing 0.3 s, FieldOfView 50.
An object per room, covering the floorCamera VolumeView the room's Fixed View, HalfExtents the room's size, BlendIn 0, BlendOut 0.
  1. Build the base setup.
  2. For each room, place an object high in a corner, facing into the room, and add a Fixed View.
  3. Add a Camera Volume that covers the room and set its View to the room's Fixed View.
  4. Play and walk from room to room. With BlendIn and BlendOut at 0 the camera cuts. Raise them for a blend instead.

Tuning​

  • Let room volumes overlap a little at doorways. They have the same priority, so the newest request wins: the camera switches as soon as the player steps into the next room and stays there until they leave it.
  • Turn on FrameTarget to zoom in when the player is far from the camera, so they keep the same size on screen. FrameSize sets how tall an area is framed.
  • Leave Target empty for a completely static angle.

Side-on rail camera​

The camera rides along a track beside a corridor, staying level with the player and looking at them, as in a side-scrolling section or a chase.

WhereComponent or modifierSettings
Track objectSplineA spline parallel to the corridor, a few meters to the side.
Rail camera objectRail ViewSpline the track object, Target the player, Mode Closest To Target, RailSmoothing 0.3 s.
CorridorCamera VolumeView the Rail View.
  1. Build the base setup.
  2. Draw a spline beside the corridor at about head height, and add a Rail View that uses it.
  3. Cover the corridor with a Camera Volume that shows the Rail View.
  4. Play and run down the corridor. The camera keeps to the point on the track closest to the player.

Tuning​

  • Set KeyOffset to a small value so the camera leads the player and shows more of what is ahead. Whether that is a positive or negative value depends on which way the spline runs.
  • For a chase that plays out the same way every time, set Mode to Scripted and move the camera with SetRailKey from a script or sequence.
warning

Use the Rail View through a Camera Director. In standalone mode it moves its own object, so it must not be on the player or the spline object.

Top-down camera​

A camera high above the player at a fixed angle, with zoom levels, rotation in 90° steps and panning, for strategy or twin-stick games.

WhereComponent or modifierSettings
An object of its ownTop-Down ViewTarget the player, Pitch 55°, ZoomDistances 8, 14, 22, the four zoom and rotate actions, PanAction, GroundFollow on.
  1. Build the base setup, but put the Top-Down View on an object of its own rather than under the character, so it does not turn with the character. Set its Target to the character and make it the director's DefaultView.
  2. Bind the zoom, rotate and pan actions in the input action map. PanAction is a vector action, for example WASD or a stick.
  3. Play. Zoom between the three distances, rotate in steps, and pan up to MaxPan meters from the player. Call ResetPan from script to move back onto the player.

Tuning​

  • For mouse-driven strategy games, turn on EdgeScroll.
  • GroundFollow keeps the camera at the same height above hills and stairs.
  • A higher Pitch looks more steeply down, while around 35° gives a more cinematic angle.

Scripted shot and dialogue​

A story beat: the camera blends to an authored shot, then back to the player. For a conversation, the shot frames the player and the person they are talking to.

WhereComponent or modifierSettings
Shot object, named DialogueShotFixed ViewTarget the person speaking, BlendTime 1 s, BlendCurve Ease In Out.
Shot viewCompositionFor a two-shot: one entry under Subjects whose Object is the player, Layout Thirds Horizontal.
DirectorFocusTarget Subject, PullTime 0.4 s. Only needed with depth of field.
  1. Build the base setup.
  2. Place the shot object where the camera should be, facing the speakers, and add a Fixed View.
  3. For a two-shot, add a Composition modifier to the shot's own Modifiers list and add the player under Subjects.
  4. From the script that starts the conversation, call ActivateView("DialogueShot", 100, 0, -1) on the director. Priority 100 beats volumes and the player view, duration 0 holds until released, and blend time -1 uses the view's BlendTime.
  5. When the conversation ends, call ReleaseViewByName("DialogueShot", 1). The camera blends back to the player over one second.

Tuning​

  • For a reveal that ends by itself, pass a duration, for example ActivateView("RevealShot", 100, 4, 1.5).
  • To glance at something without leaving the player's camera, give it a Camera Point Of Interest and call LookAtObject on the director. See Press F to look at a shrine.
  • IsBlending() tells a script when the blend has finished, for example to start the first line of dialogue.
  • A sequence that cuts to its own Main View camera takes over by itself: the director steps aside while the sequence camera is showing and blends back afterwards.

Explosions and shaking areas​

Explosions shake the camera more the closer it is, and some areas, such as a rumbling engine room, shake constantly.

WhereComponent or modifierSettings
DirectorShakeUseShakeVolumes on (the default).
Explosion prefabCamera Shake Volume SphereStrength 1, Radius 15, BurstDuration 0.4 s, OnFinishedAction Delete Component.
Engine roomCamera Shake Volume SphereStrength 0.25, Radius 10, BurstDuration 0.
  1. Build the base setup and add a Shake modifier to the director.
  2. Add a Camera Shake Volume Sphere to the explosion prefab with the burst settings above. Each explosion now shakes the camera briefly, less toward the edge of the radius.
  3. Add a constant Camera Shake Volume Sphere to the engine room.
  4. For a hit that should shake at any distance, call AddTrauma(0.5) on the director.

Tuning​

  • Trauma is squared before it moves the camera, so small values stay subtle and big hits stand out. TraumaDecay sets how fast it settles.
  • Shake volumes are measured at the camera, not at the player. A volume the player is inside but the camera is outside does not shake.
  • When gameplay code already knows where a hit happened, send a plMsgCameraImpulse with Type Shake, a Position, a Radius and a Strength instead of placing a volume.

See also: Gameplay Cameras · Camera Views · Camera Director · The Modifier Stack · Framing, Look At and Focus