fix: fixed projectile flight direction

Shooting ignored vertical rotation of controller. Fixed and simplified code.
This commit is contained in:
Kubson96 2025-04-18 02:04:39 +02:00
parent b7263615c0
commit c9914f14ea

View File

@ -64,10 +64,8 @@ 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;