Skip to content

MotionCameraComponent

MotionCameraComponent provides first-person camera control with procedural curves, height transitions, static offsets, view angle constraints, and native first-person framing.

Preview

Motion's native first-person item config workflow is currently in Preview.

If you are tuning how a first-person weapon or item sits on screen, prefer the native item config transforms when the goal is item-specific placement rather than global camera feel. Shared arm and held-item framing for the non-socket camera path is handled by MotionCameraComponent. See First-Person Item Configs.

Requirements

  • Character with standard UCapsuleComponent
  • UMotionCameraEventBus on the same character
  • Optional ASC access for camera-related GameplayTag checks
  • Optional Motion.Camera.DisableShake tag to suppress camera effects

The component automatically caches its owning character, capsule component, player camera manager, and camera event bus.

For setup steps, see How to add Motion to a character. For custom camera systems, see How to integrate a custom camera with Motion.

Behavior

Each frame, the component checks whether camera effects are enabled, evaluates active motion curves, applies static offsets, updates height interpolation, and clamps view angles before producing the final camera transform. The final camera view state is also used to keep native first-person upper-body and held-item presentation framed when the camera is not mounted to a mesh socket.

Movement components do not manipulate camera transforms directly. They broadcast curve or height events through UMotionCameraEventBus, and the camera component decides how to apply them.

API

Core camera functions

  • AreCameraEffectsEnabled() -> bool: checks whether camera effects are enabled.
  • GetOwningCharacter() -> ACharacter*: returns the cached owning character.
  • GetOwningCapsuleComponent() -> UCapsuleComponent*: returns the cached capsule component.

Height management

  • SetTargetCameraHeight(float NewHeight, bool bInterpolate = true) -> void: sets target camera height.
  • GetInterpolatedCameraHeight() -> float: returns current interpolated height.
  • UpdateCameraHeight(float DeltaTime) -> void: updates height interpolation.
  • SetCameraToStandingHeight(bool bInterpolate = true) -> void: moves camera to standing height.
  • SetCameraToCrouchedHeight(bool bInterpolate = true) -> void: moves camera to crouched height.
  • ConfigureCameraHeights(float NewStandingHeight, float NewCrouchedHeight) -> void: updates standing and crouched heights.
  • GetBaseEyeHeight() -> float: returns base eye height offset.

Motion curves

  • AddMotionCurve(const FMotionCurve& MotionCurve) -> int32: adds a camera effect curve.
  • RemoveMotionCurve(const FString& Identifier) -> void: removes a curve by identifier.
  • SetMotionCurvePaused(const FString& Identifier, bool bPaused) -> void: pauses or resumes a curve.
  • ResetMotionCurve(const FString& Identifier) -> void: resets a curve to its start.
  • GetActiveMotionCurves() -> const TArray<FMotionCurve>&: returns active curves.
  • FindCurveIndexByIdentifier(const FString& Identifier) -> int32: finds a curve index by identifier.

Static offsets

  • AddStaticLocationOffset(const FString& Identifier, const FVector& Offset) -> void: adds persistent location offset.
  • AddStaticRotationOffset(const FString& Identifier, const FRotator& Offset) -> void: adds persistent rotation offset.
  • RemoveStaticLocationOffset(const FString& Identifier) -> void: removes a location offset.
  • RemoveStaticRotationOffset(const FString& Identifier) -> void: removes a rotation offset.
  • ClearAllStaticOffsets() -> void: clears all static offsets.
  • GetCameraTargetOffset() -> const FRuntimeVectorCurve&: returns the pitch-based target offset curve.

Internal processing

  • UpdateMotionCurves(float DeltaTime) -> void: updates all active curves.
  • CalculateCurveTransforms() -> void: calculates combined curve transform.
  • GetCombinedStaticLocationOffset() -> FVector: returns combined static location offset.
  • GetCombinedStaticRotationOffset() -> FRotator: returns combined static rotation offset.
  • PrintDebugInformation() -> void: prints debug output when enabled.

Event bus handlers

  • HandleCurveEvent(const FMotionCurve& Curve, EMotionCameraAction Action) -> void: handles add, remove, pause, and resume events.
  • HandleHeightEvent(float Height, bool bInterpolate) -> void: handles camera height events.
  • SubscribeToEventBus() -> void: subscribes to UMotionCameraEventBus.

Overrides

  • GetCameraView(float DeltaTime, FMinimalViewInfo& DesiredView) -> void: applies Motion camera logic.
  • GetEditorPreviewInfo(float DeltaTime, FMinimalViewInfo& ViewOut) -> bool: supplies editor preview information.

Native first-person rendering

  • ConfigureNativeFirstPersonPresentation() -> void: configures the local first-person body mesh roles.
  • IsNativeFirstPersonPresentationEnabled() -> bool: returns whether native first-person body presentation is active locally.
  • GetFirstPersonUpperBodyComponent() -> USkeletalMeshComponent*: returns the resolved FirstPersonUpperBody mesh.
  • GetFirstPersonLowerBodyComponent() -> USkeletalMeshComponent*: returns the resolved FirstPersonLowerBody mesh.
  • ApplyNativeFirstPersonRenderTuning(const FMotionNativeFirstPersonItemRenderTuning& RenderTuning) -> bool: applies supported item render tuning to the whole first-person set.
  • ClearNativeFirstPersonRenderTuning() -> void: restores native first-person camera defaults.
  • GetCurrentNativeFirstPersonFieldOfView() -> float: returns the active native first-person FOV.
  • GetCurrentNativeFirstPersonScale() -> float: returns the active native first-person scale.
  • GetLastFinalCameraViewState() -> FMotionFinalCameraViewState: returns the last final camera view state used for native first-person framing.
  • GetFirstPersonFramingState() -> FMotionFirstPersonFramingState: returns the current safe-box framing state, including active anchors, screen error, clamp flags, bypass reason, presentation basis, and applied local correction.
  • GetFirstPersonFramingSettings() -> FMotionFirstPersonFramingSettings: returns the native first-person framing settings.
  • SetFirstPersonFramingSettings(const FMotionFirstPersonFramingSettings& NewSettings) -> void: updates safe-box bounds, anchors, axis limits, smoothing, and socket-mode policy.
  • ResetFirstPersonFraming() -> void: clears smoothing and captures the current first-person upper-body rest transform.

Configuration

Shared camera presentation configuration lives on the assigned MotionCameraProfile. The current Motion default is /MotionCore/Motion/Profiles/v2_0_0/DA_MotionCameraProfile_Default_v2_0_0.

Camera height

  • BaseEyeHeight: offset from the capsule-derived height. Default: -10.0f.
  • HeightInterpolationSpeed: interpolation speed. Default: 12.0f.

Standing and crouched camera targets are derived from the owning capsule and crouch-height events, plus BaseEyeHeight. They are runtime camera fields, not profile-authored constants.

View angle constraints

  • ViewPitchMin: minimum pitch angle. Default: -89.0f.
  • ViewPitchMax: maximum pitch angle. Default: 89.0f.
  • ViewYawMin: minimum yaw angle. Default: -359.99f.
  • ViewYawMax: maximum yaw angle. Default: 359.99f.
  • ViewRollMin: minimum roll angle. Default: -359.99f.
  • ViewRollMax: maximum roll angle. Default: 359.99f.

Target and debug

  • CameraTargetOffset: pitch-based target offset curve. Diagnostics such as debug display and detailed curve logging remain component-owned.

Native first-person body setup

  • bEnableNativeFirstPersonPresentation: enables local native first-person body setup.
  • NativeFirstPersonFieldOfView: default camera first-person FOV.
  • NativeFirstPersonScale: default camera first-person scale.
  • FirstPersonFramingSettings: optional safe-box settings for non-socket upper-body and held-item framing.

The owning character must provide FirstPersonUpperBody and FirstPersonLowerBody skeletal mesh components. On the owning client, Motion marks those components as FirstPerson primitives and marks the full-body mesh as the WorldSpaceRepresentation.

When CameraPivotSocketName is empty or invalid, Motion computes the camera from capsule/ground height, pitch target offset, static offsets, and active camera curves. In that non-socket path, MotionCameraComponent projects weighted first-person anchors into the final camera view, calculates error outside the configured safe box, and applies bounded local correction to FirstPersonUpperBody; any active first-person held item follows through FirstPersonUpperBody.weapon_r. FirstPersonLowerBody stays grounded as visible-body presentation.

Default framing does not pitch-rotate the upper-body component. It uses a yaw-stable presentation basis for local correction and tightens correction at steep downward pitch so looking down does not pull the upper body away from the visible body.

CameraTargetOffset curves remain useful for camera feel. They are not required to keep native first-person arms or held items visible in the default sample.

The component's editable setup surface is the Profile reference. Active curve playback state, static offset runtime maps, final view state, cached owner references, and diagnostics remain component-owned.

Read-Only State

  • OwningCharacter: cached owning character.
  • OwningCapsuleComponent: cached capsule component.
  • OwningPlayerCameraManager: cached player camera manager.
  • CachedEventBus: cached camera event bus.
  • CachedAbilitySystemComponent: cached ability system component.
  • DefaultCapsuleHalfHeight: cached default capsule half height.
  • CurrentCameraHeight: current interpolated height.
  • TargetCameraHeight: target interpolation height.
  • bIsInterpolatingHeight: whether height interpolation is active.
  • ActiveMotionCurves: active camera curves.
  • StaticLocationOffsets: persistent location offsets.
  • StaticRotationOffsets: persistent rotation offsets.
  • CameraLocationFromCurves: combined location offset from curves.
  • CameraRotationFromCurves: combined rotation offset from curves.
  • LastFinalCameraViewState: final view state consumed by native first-person framing.
  • FirstPersonFramingState: current-frame safe-box framing state for native first-person presentation.

Motion Curves

FMotionCurve defines procedural camera animation. The most important fields are:

  • Identifier: unique string ID.
  • TranslationCurve: XYZ position offsets over time.
  • RotationCurve: pitch, yaw, and roll offsets over time.
  • Duration: total curve duration in seconds.
  • PlayRate: playback speed multiplier.
  • bLoop: whether the curve repeats.
  • bStartPaused: whether the curve starts paused.
  • CurrentTime: current playback time, managed by the component.
  • bIsPaused: current pause state.

Static Offset System

Static offsets are persistent additive camera adjustments that remain active until removed. Use them for camera behavior such as ADS or lean. Use MotionNativeFirstPersonItemConfig transforms when the adjustment is item presentation, attach-space framing, or per-item local first-person positioning.

Offsets are additive, persistent, named, and separated between location and rotation.

Camera Height Management

Camera height is tracked independently from capsule height. The component supports smooth interpolation, instant changes, base eye height tuning, and state tracking for transition progress.

Event Bus Integration

Motion components communicate with the camera through UMotionCameraEventBus:

  • Walk broadcasts subtle walking bob curves.
  • Sprint broadcasts sprint camera shake.
  • Jump broadcasts jump and landing camera effects.
  • Crouch broadcasts camera height transition events.
  • Breathing broadcasts idle breathing camera motion.

Event actions are:

  • EMotionCameraAction::Add: start playing a curve.
  • EMotionCameraAction::Remove: stop and remove a curve by identifier.
  • EMotionCameraAction::Pause: pause a curve.
  • EMotionCameraAction::Resume: resume a paused curve.

Processing order is motion curves, static offsets, height interpolation, view generation, and native first-person framing from the final view state.

Custom Camera Compatibility

If you use your own camera system instead of UMotionCameraComponent, subscribe to the Camera Event Bus to receive effect events from Motion components. See How to integrate a custom camera with Motion for implementation steps.

Motion - Advanced First Person Character Controller