UPROPERTY(EditAnywhere, Category = CameraShake)
bool bEnableShakeCompensation;

UPROPERTY(EditAnywhere, Category = CameraShake)
float ShakeCompensationIntensity;

#include "ShakeController.h"
AShakeController::AShakeController()
{
Amplitude = FVector(10.0f, 10.0f, 10.0f);
    Speed = 1.0f;
    ShakeTimer = 0.0f;
}
void AShakeController::Tick(float DeltaSeconds)
{
    Super::Tick(DeltaSeconds);
    Shake(DeltaSeconds);
}
void AShakeController::Shake(float DeltaTime)
{
ShakeTimer += DeltaTime * Speed;
float OffsetX = FMath::Sin(ShakeTimer) * Amplitude.X;
    float OffsetY = FMath::Sin(ShakeTimer) * Amplitude.Y;
    float OffsetZ = FMath::Sin(ShakeTimer) * Amplitude.Z;
    FVector ShakeOffset = FVector(OffsetX, OffsetY, OffsetZ);
    SetActorLocation(GetActorLocation() + ShakeOffset);
}