fix: fixed projectile flight direction
Shooting ignored vertical rotation of controller. Fixed and simplified code.
This commit is contained in:
parent
b7263615c0
commit
c9914f14ea
|
|
@ -63,11 +63,9 @@ void UShootingComponent::MeleAttack()
|
||||||
}
|
}
|
||||||
|
|
||||||
AActor* UShootingComponent::ExecuteLineTrace(float LineRange)
|
AActor* UShootingComponent::ExecuteLineTrace(float LineRange)
|
||||||
{
|
{
|
||||||
FVector ForwardVector = PlayerCharacter->GetActorForwardVector();
|
FVector ForwardVector = CameraManager->GetActorForwardVector();
|
||||||
FVector ViewLocation;
|
FVector ViewLocation = CameraManager->GetCameraLocation();
|
||||||
FRotator ViewRotation;
|
|
||||||
PlayerCharacter->GetController()->GetPlayerViewPoint(ViewLocation, ViewRotation);
|
|
||||||
|
|
||||||
FVector EndVector = ViewLocation + ForwardVector * LineRange;
|
FVector EndVector = ViewLocation + ForwardVector * LineRange;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user