Bugfix Attack Line Trace Unable to Reach Player

This commit is contained in:
Philip W 2024-02-29 12:36:12 +00:00
parent 07671f3c2a
commit 97d2b53c15

View File

@ -27,7 +27,7 @@ EBTNodeResult::Type UBTTask_AttackPlayer::ExecuteTask(UBehaviorTreeComponent& Ow
} }
FVector const Origin = IsValid(GunSKMesh) ? GunSKMesh->GetComponentLocation() : AIController->GetPawn()->GetActorLocation() + FVector(0.f, 0.f, 30.f); FVector const Origin = IsValid(GunSKMesh) ? GunSKMesh->GetComponentLocation() : AIController->GetPawn()->GetActorLocation() + FVector(0.f, 0.f, 30.f);
FVector const Start = Origin; FVector const Start = Origin;
FVector const End = Origin + AIController->GetPawn()->GetActorForwardVector() * 10000.f; FVector const End = Origin + AIController->GetPawn()->GetActorForwardVector() * 100000.f;
if (AEnemyCharacter* const EnemyCharacter = Cast<AEnemyCharacter>(AIController->GetPawn())) if (AEnemyCharacter* const EnemyCharacter = Cast<AEnemyCharacter>(AIController->GetPawn()))
{ {
EnemyCharacter->FireWeapon.Broadcast(); EnemyCharacter->FireWeapon.Broadcast();