I have a CPP code for detecting when an Actor hit something (using a sockat location).
this code detects overlaps on Characters (BP subclass of a class that subclasses ACharacter), but when I try hit on another enemy that is a BP that inherits from a Pawn it doesn’t detect.
TArray<TEnumAsByte<EObjectTypeQuery>> TraceObjectTypes;
TraceObjectTypes.Add(UEngineTypes::ConvertToObjectType(ECollisionChannel::ECC_Pawn));
UClass* SeekClass = AActor::StaticClass();
TArray<AActor*> ActorsToIgnore;
ActorsToIgnore.Init(Owner, 1);
TArray<AActor*> HitActors;
UKismetSystemLibrary::SphereOverlapActors(Owner, SocketLocation, HitRadius, TraceObjectTypes, SeekClass, ActorsToIgnore, HitActors);
Watched and read about it and I’ve tried all kinds of capsule/box collision components with different settings in the collision and the Cuve mesh…
and yet I don’t know why it doesn’t detect the overlap with the Pawn.
Pawn BP that doesn’t trigger sphere:
Character the does trigger sphere
thanks for the help