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
- Add
UMotionBreathingComponentto your Character Blueprint or C++ class - Ensure MotionCameraComponent is also added to the character
- Configure the
CameraBreathingCurvewith your desired breathing pattern:- Set Translation curves for subtle head movement
- Configure Rotation curves for natural head tilt
- Adjust PlayRate for breathing rhythm
- Set the
BreathingActiveTagEffecttoGE_Motion_BreathingActive - The component will automatically activate when the character is idle


Functionality
Breathing State Machine
Expandability
The MotionBreathingComponent provides virtual functions for customization:
Core Functions
| Function | Parameters | Returns | Use Case Examples |
|---|---|---|---|
IsBreathingActive() | None | bool | • Query state • UI indicators |
State Management Functions
| Function | Parameters | Returns | Use Case Examples |
|---|---|---|---|
UpdateBreathingState() | None | void | • State logic • Condition checks |
StartBreathing() | None | void | • Begin effect • Sound trigger |
StopBreathing() | None | void | • End effect • Clean up |
InitializeComponent() | None | void | • Setup refs • Validation |
Utility Functions
| Function | Parameters | Returns | Use Case Examples |
|---|---|---|---|
IsCharacterWalking() | None | bool | • Movement check • State detection |
GenerateCurveIdentifier() | None | FString | • Unique IDs • Multi-component |
PrintDebugInformation() | None | void | • Debug display • State logging |
Configuration
Breathing Settings
| Property | Type | Description |
|---|---|---|
| CameraBreathingCurve | FStructMotionCurve | The 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
| Property | Type | Description |
|---|---|---|
| BreathingActiveTagEffect | TSubclassOf<UGameplayEffect> | Grants breathing active tag |
Read-Only State Properties
| Property | Type | Description |
|---|---|---|
| BreathingCurveIdentifier | FString | Unique identifier for breathing curve |
| bHasActiveCurve | bool | Whether breathing curve is currently active |
| bWasWalkingLastFrame | bool | Previous frame's walking state |
| BreathingActiveTagHandle | FActiveGameplayEffectHandle | Handle to active tag effect |
Debug Configuration
| Property | Type | Default | Description |
|---|---|---|---|
| bShowDebugInformation | bool | false | Debug 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