I tried implementing a capsule component on the enemy base class like so:
AEnemy::AEnemy()
{
PrimaryActorTick.bCanEverTick = true;
EnemyIdentifier = CreateDefaultSubobject<UCapsuleComponent>(TEXT("Enemy
Identifier"));
EnemyIdentifier->InitCapsuleSize(5.f, 5.f);
EnemyIdentifier->SetupAttachment(RootComponent);
EnemyIdentifier->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
EnemyIdentifier->SetCollisionResponseToChannel(ECC_GameTraceChannel2,
ECR_Overlap);
}
And now no collision is being detected by my sweep which looks the same as before with the exception of changing the channel name
bool bHitSuccess = GetWorld()->SweepMultiByChannel(OutHits, PlayerCharacter->GetActorLocation(), PlayerCharacter->GetActorLocation(), FQuat::Identity, ECC_GameTraceChannel2, HitSphere);
But weirdly enough while messing with the capsule component I made in the constructor at a certain point I went from being able to edit and view the component in my Zombie blueprint, to seeing two versions of the component, to then only one again except now when I click on it the details window is blank. Any idea what’s going on?