Bugfix Debug Lines Marked Green on Missed Traces

This commit is contained in:
Philip W 2022-11-21 22:35:04 +00:00
parent 22c13a8c25
commit c6cba80a07

View File

@ -308,12 +308,12 @@ bool ARealTimeCombat::HitEnemy() const
CollisionParams.AddIgnoredActor(PlayerActor);
if (GetWorld()->LineTraceSingleByChannel(HitResult, Start, End, ECC_Pawn, CollisionParams))
{
DrawDebugLine(GetWorld(), Start, End, HitResult.bBlockingHit ? FColor::Green : FColor::Red, false, 5.0f, 0, 10.0f);
DrawDebugLine(GetWorld(), Start, End, FColor::Green, false, 5.0f, 0, 10.0f);
if (HitResult.GetActor() == EnemyActor)
{
return true;
}
}
DrawDebugLine(GetWorld(), Start, End, HitResult.bBlockingHit ? FColor::Green : FColor::Red, false, 5.0f, 0, 10.0f);
DrawDebugLine(GetWorld(), Start, End, FColor::Red, false, 5.0f, 0, 10.0f);
return false;
}