Skip to main content

Camera and possession

The two models

Both are legitimate and games genuinely need both, so this is a per-seat setting rather than an architectural decision baked into a class hierarchy.

Keep Possessing the Rider — the default

The controller never lets go of the character. Driving input is forwarded through ApplyDriverInput.

  • Nothing else in your game has to learn that "the pawn" is sometimes a car. Ability systems, inventories and HUDs keep pointing at the character.
  • No possession churn, so no class of bug where a controller possesses a vehicle that is then destroyed.
  • A passenger can still aim a weapon, use an ability, open an inventory.
  • The camera follows automatically: the character is attached to the seat, so a spring arm on the character is carried by the vehicle.

The cost is that the vehicle receives no input of its own, so you forward it. That is about ten lines — see Vehicles.

Possess the Mount

The controller possesses the mount pawn and the character becomes scenery. This is what the engine's vehicle template does.

  • Your existing vehicle input, camera and HUD keep working unchanged.
  • The character's own input is inert while seated, with nothing to unbind.

The cost is that everything pointing at "the player's pawn" now sometimes points at a car.

The rider component stores which controller it took the pawn from and re-possesses on detach, so the way back is one object rather than three. Possession changes happen on the server only.

Mixing them in one vehicle

The driver's seat can be Possess the Mount while the passenger seats are Keep Possessing the Rider. That is often exactly right: the driver wants the vehicle's camera and HUD, and the passenger wants to stay themselves.

The rider's body

FEDRiderPolicy, per seat, defaulting to the project setting:

SettingDefaultWhy
CollisionDisabledA capsule bolted to a moving vehicle is a physics problem looking for a place to happen. Query Only keeps traces and overlaps working without anything pushing the rider — usually what a turret gunner wants.
Disable Movement ComponenttrueA character movement component that keeps simulating while its owner is welded to a car fights the attachment every frame, and wins often enough to be noticed.
Suppress Movement ReplicationtrueThe seat's transform already comes from the mount. Replicating the rider's location too is the same information twice, and the two disagree during correction — which is the passenger who jitters half a metre behind their seat.
Hide Rider MeshfalseFor interiors with a separate first-person body.
Always Tick Pose While SeatedtrueA passenger is inside the mount's bounds, so they are culled by the mount's visibility. Without this they freeze mid-pose in the seat next to you when your camera turns.

Everything captured on the way in is restored exactly on the way out — from a capture, not from assumed defaults, so a rider whose collision or replication settings were never the engine's defaults gets its own values back.

The camera

The framework does not move cameras. That is deliberate: games do camera work very differently, and a framework that took a position here would be in the way of most of them.

What it does provide:

A seat can name a camera target. Set the seat's Seat Camera to a component on the mount, and ask for it at runtime:

if (USceneComponent* Target = Rider->GetSeatCameraComponent())
{
// Point your camera manager, spring arm or Blueprint at it.
}

It moves with the mount, because it is a component on the mount.

A phase-changed event to react to. OnMountPhaseChanged fires on every machine. The example character uses it for the one thing most games want:

void AMyCharacter::OnMountPhaseChanged_Implementation(EEDMountPhase NewPhase, EEDMountPhase,
AActor*, FEDSeatHandle)
{
// The boom is on the character, and the character is attached to the seat, so it is already
// carried by the vehicle. Only the distance changes.
CameraBoom->TargetArmLength = (NewPhase != EEDMountPhase::None) ? 800.f : 350.f;
}

Under Keep Possessing the Rider that is often the entire camera integration: a spring arm on the character is attached to the seat along with the character, so it follows the vehicle for free.

Under Possess the Mount, the mount's own camera takes over the moment possession changes, and the character's is irrelevant while seated.