Fixed AI and Shot Collision Issues

This commit is contained in:
Rafal Swierczek 2024-03-18 21:54:41 +00:00
parent fbff6fdd62
commit ebb981646d
10 changed files with 18 additions and 18 deletions

Binary file not shown.

Binary file not shown.

View File

@ -37,7 +37,7 @@ EBTNodeResult::Type UBTTask_AttackPlayer::ExecuteTask(UBehaviorTreeComponent& Ow
FCollisionObjectQueryParams ObjectQueryParams;
ObjectQueryParams.AddObjectTypesToQuery(ECC_Pawn);
ObjectQueryParams.AddObjectTypesToQuery(ECC_WorldStatic);
ObjectQueryParams.AddObjectTypesToQuery(ECC_WorldDynamic);
//ObjectQueryParams.AddObjectTypesToQuery(ECC_WorldDynamic);
if (FHitResult HitResult; GetWorld()->LineTraceSingleByObjectType(HitResult, Start, End, ObjectQueryParams, QueryParams))
{
if (IsValid(HitResult.GetActor()))

View File

@ -188,7 +188,7 @@ void ABaseWeaponClass::Fire()
FCollisionObjectQueryParams ObjectQueryParams;
ObjectQueryParams.AddObjectTypesToQuery(ECC_Pawn);
ObjectQueryParams.AddObjectTypesToQuery(ECC_WorldStatic);
ObjectQueryParams.AddObjectTypesToQuery(ECC_WorldDynamic);
//ObjectQueryParams.AddObjectTypesToQuery(ECC_WorldDynamic);
GetWorld()->LineTraceSingleByObjectType(outHit, traceStart, traceEnd, ObjectQueryParams, collisionParams);
WeaponFired.Broadcast();
playerControllerRef->PlayerCameraManager->StartCameraShake(CameraShakeClass, 1);