Hello, I’d love some input on this issue I’ve been dealing with for days now. I have found several questions referencing a similar problem, but based on the responses to those (link to one of the posts I viewed), everything should be working fine.
The problem: UBoxComponents added to my actor with CreateDefaultSubobject do not trigger overlap events. (in general, their collision settings - whatever they are - don’t seem to work
Example the works: Creating a BP from my C++ actor and adding a box component, copying the properties from the C+±created component, and binding an event in task graph to OnComponentBeginOverlap, works normally.
What I’m doing: I’m trying to add trigger volumes to a static interact-able actor in the level.
More context: I tried binding the OnComponentBeginOverlap of the C+±created box component in the BP task graph, but that also doesn’t work. Even calling GetOverlappingActors on the C+±created box in the actor tick function returns en empty set every time. As mentioned, the properties of both the C+±created box and the BP-created box are the same. This is the code I wrote to create the component in c++:
Mesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Mesh"));
SetRootComponent(Mesh);
Box = CreateDefaultSubobject<UBoxComponent>(TEXT("TriggerArea"));
Box->SetSimulatePhysics(false);
Box->InitBoxExtent(FVector(100, 100, 100));
Box->SetupAttachment(Mesh);
Box->SetCollisionProfileName(UCollisionProfile::Pawn_ProfileName);
Box->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
Box->SetCollisionObjectType(ECC_WorldDynamic);
Box->SetGenerateOverlapEvents(true);
Is this a bug? Am I missing something obvious?
EDIT: I have tried to SetCollisionResponseToAllChannels(Overlap), and pretty much did exactly what this says.
Thanks for your time,
Dan