ULimenCameraShakeComponent
Overview
ULimenCameraShakeComponent is a custom camera shake component designed to dynamically adjust the intensity of camera shakes based on the movement speed of a pawn. It inherits from UCameraShakeSourceComponent and integrates with Unreal Engine's camera shake system to provide smooth and responsive visual effects during gameplay.
Properties
Type | Name | Access | Description |
|---|---|---|---|
FPair | SlowestSpeedScale | EditAnywhere, Category=" Limen " | Defines the speed scale at which the camera shake intensity is at its minimum. |
FPair | FastestSpeedScale | EditAnywhere, Category=" Limen " | Defines the speed scale at which the camera shake intensity is at its maximum. |
TObjectPtr | CameraShakePtr | Protected | Pointer to the currently active camera shake instance. |
float | CachedSpeed | Private | Stores the cached speed value for comparison in tick function. |
Functions
Return Type | Signature | Description |
|---|---|---|
void | BeginPlay() | Initializes the component and sets up the movement component reference. |
void | TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) | Updates the camera shake intensity based on the pawn's current speed. |
void | Activate(bool bReset) | Activates the camera shake effect. |
void | Deactivate() | Deactivates the camera shake effect. |
float | GetSpeed() const | Retrieves the current speed of the pawn associated with this component. |
Usage & Implementation Notes
The component requires a
UPawnMovementComponentto function correctly.Camera shakes are managed through Unreal Engine's
PlayerCameraManager.The intensity of camera shakes is dynamically adjusted based on the pawn's movement speed, ensuring smooth and responsive visual effects during gameplay.