Skip to content

MotionBreathingComponent

Applies subtle breathing motion to the camera when the character is stationary, adding life and realism to the first-person view. Automatically manages breathing state based on character movement with seamless transitions.

Requirements

  • Character with MotionCameraComponent attached
  • MotionPlayerState configured in GameMode
  • Gameplay Ability System (GAS) initialized
  • Gameplay Effects:
    • GE_Motion_BreathingActive - Grants breathing active tag
  • Gameplay Tags:
    • Motion.Camera.BreathingActive - Active when breathing effect is applied

Installation

  1. Add UMotionBreathingComponent to your Character Blueprint or C++ class
  2. Ensure MotionCameraComponent is also added to the character
  3. Configure the CameraBreathingCurve with your desired breathing pattern:
    • Set Translation curves for subtle head movement
    • Configure Rotation curves for natural head tilt
    • Adjust PlayRate for breathing rhythm
  4. Set the BreathingActiveTagEffect to GE_Motion_BreathingActive
  5. The component will automatically activate when the character is idle

Functionality

Breathing State Machine

Expandability

The MotionBreathingComponent provides virtual functions for customization:

Core Functions

FunctionParametersReturnsUse Case Examples
IsBreathingActive()Nonebool• Query state
• UI indicators

State Management Functions

FunctionParametersReturnsUse Case Examples
UpdateBreathingState()Nonevoid• State logic
• Condition checks
StartBreathing()Nonevoid• Begin effect
• Sound trigger
StopBreathing()Nonevoid• End effect
• Clean up
InitializeComponent()Nonevoid• Setup refs
• Validation

Utility Functions

FunctionParametersReturnsUse Case Examples
IsCharacterWalking()Nonebool• Movement check
• State detection
GenerateCurveIdentifier()NoneFString• Unique IDs
• Multi-component
PrintDebugInformation()Nonevoid• Debug display
• State logging

Configuration

Breathing Settings

PropertyTypeDescription
CameraBreathingCurveFStructMotionCurveThe breathing shake curve applied to camera:
• Translation curves for subtle head bob (X, Y, Z)
• Rotation curves for natural head tilt (Pitch, Yaw, Roll)
• PlayRate for breathing rhythm speed
• Duration for complete breath cycle
• Multiplier for effect intensity

GAS Integration

PropertyTypeDescription
BreathingActiveTagEffectTSubclassOf<UGameplayEffect>Grants breathing active tag

Read-Only State Properties

PropertyTypeDescription
BreathingCurveIdentifierFStringUnique identifier for breathing curve
bHasActiveCurveboolWhether breathing curve is currently active
bWasWalkingLastFrameboolPrevious frame's walking state
BreathingActiveTagHandleFActiveGameplayEffectHandleHandle to active tag effect

Debug Configuration

PropertyTypeDefaultDescription
bShowDebugInformationboolfalseDebug information display

State Access

Query breathing state for gameplay logic:

  • IsBreathingActive() - Check if breathing effect is currently active
  • GetMotionCameraComponent() - Access the camera component for custom effects

Automatic Activation

The component automatically manages breathing state:

  • Instant activation when character becomes idle
  • Immediate deactivation when movement starts
  • No delay or transition time for responsive feel
  • Frame-perfect detection of movement state changes

Motion - Advanced First Person Character Controller