feat: small camera movements

This commit is contained in:
Kubson96 2025-05-15 19:15:32 +02:00
parent 319e45e27b
commit 1845537987
2 changed files with 18 additions and 0 deletions

View File

@ -324,4 +324,13 @@ void UShootingComponent::TickComponent(float DeltaTime, ELevelTick TickType, FAc
float CurrentFOV = CameraManager->GetFOVAngle();
float NewFOV = FMath::FInterpTo(CurrentFOV, TargetFOV, DeltaTime, AimingAnimationSpeed);
CameraManager->SetFOV(NewFOV);
BreathingTimer += DeltaTime;
float PitchOffset = FMath::Sin(2.0f * PI * PitchFrequency * BreathingTimer);
float YawOffset = FMath::Sin(2.0f * PI * YawFrequency * BreathingTimer + YawPhaseOffset);
// Dodanie inputów
PlayerCharacter->AddControllerPitchInput(PitchOffset * PitchAmplitude);
PlayerCharacter->AddControllerYawInput(YawOffset * YawAmplitude);
}

View File

@ -116,4 +116,13 @@ private:
bool bIsFirstGunSelected = true;
float MeleDamageValue = 50.f;
float BreathingTimer = 0.0f;
float PitchFrequency = 0.25f;
float YawFrequency = 0.22f;
float PitchAmplitude = 0.003f;
float YawAmplitude = 0.002f;
float YawPhaseOffset = PI / 3.0f;
};