Skip to main content

Description

LCKCameraController is a Unity MonoBehaviour that manages the full in-game camera system for LCK. It switches between three virtual cameras (Selfie, First Person, Third Person), applies stabilisation and smoothing, handles FOV and distance adjustments from UI controls, toggles between portrait and landscape orientation, and communicates the active camera and track settings to ILckService. It can also auto-configure culling masks to hide the tablet layer from the Selfie view.

Usage

Use LCKCameraController when you need a ready-made camera rig that handles mode switching, orientation, and recording controls through Unity UI. Add it to a GameObject and assign your UI controls, camera/stabilizer components for each mode, and optionally an ILckQualityConfig ScriptableObject for quality presets.

Toggle recording from a UI button

This disables orientation/quality/top buttons while capture starts, and re-enables on stop or failure.

Switch orientation safely

Updates ILckService camera orientation, resizes the preview, and recalculates FOV to preserve perceived width in Portrait.

Flip selfie camera / set third-person position

Flips preview scale and stabilizer orientation for Selfie; toggles in-front/behind for Third Person.

References

Serialized Fields & Options

Properties

Camera Modes

  • Selfie — parented to the tablet; supports flip (front/back), smoothing/FOV, hides tablet layer from the view.
  • First Person — follows HMD (position + slight forward offset), smoothing/FOV, instant snap after mode switch.
  • Third Person — orbital camera with height angle and adjustable distance; toggle front/behind; smoothing/FOV.

Key Methods

Lifecycle & Internals

  • Injects or initialises ILckService (fallback DI setup in Awake if missing).
  • Subscribes to service events to reflect capture state; unsubscribes and stops recording on destroy.
  • Optional auto-layer/culling setup hides tablet layer from Selfie, shows it for others.
  • Recomputes Portrait FOV to maintain perceived width using the current descriptor’s resolution.

See Also

  • ILckService — Service interface used for recording, streaming, and camera registration
  • LckCamera — Lower-level camera registration if you need custom camera control
  • LckQualityConfig — Quality preset configuration used by the quality selector
  • CameraTrackDescriptor — Resolution and format settings updated on quality/orientation changes