From c9914f14ea5d5a6decada9bb2e0d6f3719d5c58a Mon Sep 17 00:00:00 2001 From: Kubson96 <42842162+Kubson96@users.noreply.github.com> Date: Fri, 18 Apr 2025 02:04:39 +0200 Subject: [PATCH] fix: fixed projectile flight direction Shooting ignored vertical rotation of controller. Fixed and simplified code. --- .../Private/Characters/Components/ShootingComponent.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Source/Exo/Private/Characters/Components/ShootingComponent.cpp b/Source/Exo/Private/Characters/Components/ShootingComponent.cpp index c406cfa..1eb3226 100644 --- a/Source/Exo/Private/Characters/Components/ShootingComponent.cpp +++ b/Source/Exo/Private/Characters/Components/ShootingComponent.cpp @@ -63,11 +63,9 @@ void UShootingComponent::MeleAttack() } AActor* UShootingComponent::ExecuteLineTrace(float LineRange) -{ - FVector ForwardVector = PlayerCharacter->GetActorForwardVector(); - FVector ViewLocation; - FRotator ViewRotation; - PlayerCharacter->GetController()->GetPlayerViewPoint(ViewLocation, ViewRotation); +{ + FVector ForwardVector = CameraManager->GetActorForwardVector(); + FVector ViewLocation = CameraManager->GetCameraLocation(); FVector EndVector = ViewLocation + ForwardVector * LineRange;