A third-person shooter
An over-the-shoulder camera that tightens when you aim, swaps shoulders, kicks with every shot and flinches when you're hit.
The camera most third-person shooters want: relaxed over the shoulder while you move, tight and steady when you aim, a recoil that climbs under automatic fire, and a shove from wherever a hit came from. Everything here ships with the plugin; the work is wiring it to your input and your weapons.
The camera#
- 1
Add the camera.
A Blendable Follow Camera on your character, with its Preset set to Third Person.
- 2
Add the shakes.
A Blendable Shake on the same character. Third Person's Rigs bring a Steadicam operator and the default body motion with them, so leave its Body empty.
- 3
Bind aiming.
From your aim input, call Set Aiming on the Follow Camera: on when the button goes down, off when it comes up. The Aim state's Rig comes in: 1.5 metres back on a 55° lens, the character well over to the left.
- 4
Bind the shoulder.
Call Toggle Shoulder from a button. The framing mirrors to the other side over a quarter of a second, on every Rig at once.
That's the whole camera. Third Person also swaps shoulder by itself when you hug a wall, slides the shot through doorways with gap centring, and drifts into an idle shot after ten seconds of nothing.
Weapons#
Each weapon is a shake from Shakes/Weapons, played from the weapon's firing code on the character's Blendable Shake:
| Weapon | Shake | How to play it |
|---|---|---|
| a pistol | Shake_Weapon_Pistol | Play Shake once per shot |
| a shotgun | Shake_Weapon_Shotgun | Play Shake once per shot |
| an automatic rifle | Shake_Weapon_Rifle | Play Shake when the trigger goes down and keep the handle. Send Camera Event named Fire for every round. Stop Shake with the handle when the trigger comes up |
| a minigun | Shake_Weapon_Minigun | the same as the rifle; stopping it lets the barrels spin down |
The rifle climbs because its recoil layer Builds Up: rounds that land before the last kick settles add up, to three and a half kicks at most, and drain away once the firing stops. Turn Most Build Up down for a weapon that's easier to hold, or up for one that fights you.
Steady hands when you aim#
Call Set Focus Input on the Blendable Shake with 1 when you aim down sights, and 0 when you stop. The shipped operator and body steady themselves on it, so the breathing settles as the gun comes up. Holding a breath on a scope works the same way: Focus is any amount from 0 to 1, so ease it up while the breath is held.
Getting hit#
Play Shake_Impact_LightHit or Shake_Impact_HeavyHit with Play Shake, and pass the direction the blow travelled as Direction: from the attacker towards you. The camera is shoved away from the hit, so the player feels where it came from before they see it.
Explosions go through Play Shake At with the blast's location: Shake_World_ExplosionNear for one that could hurt you, Shake_World_ExplosionFar for one across the map. Each fades with distance and plays nothing at all out of range.
When health runs low, play Shake_State_LowHealth and raise it with Set Shake Scale as health falls. Stop it when they heal.
Comfort#
Shooters move the camera a lot, so give players the options. Bind your settings menu to the Follow Camera's comfort settings: Shake Scale for the recoil and hits, Handheld Scale for the operator, FOV Steps for a wider view, and Keep Horizon Level for anyone who gets motion sick. Set Reduce Motion turns everything down in one call.
Going further#
- First person. Third Person has a first-person view, FPS. Call Select View Mode with
FPSto switch, or Cycle View Mode from a single button. A view can have Rigs of its own for states like Aim, so aiming in first person can stay in first person. - Crouching. A Character is read by itself. Another kind of pawn calls Set Crouched.
- A tighter scope. Add a camera state of your own to the preset's Camera States, say
Scope, with a narrower Rig and a priority above Aim's 10, and turn it on with Set Camera State. - Lock-on. Add a lock-on with the Ranged preset: the target sits in the middle of the screen, where your aim is.