I’m working with the first person shooter template program, and trying to modify the projectiles to pass through each other. I don’t want them to be immune to colliding with projectiles in general, but to never interact with the owner or any other projectiles from the same source.
The plan for this was to change it to overlap and then use logic to determine if the overlap should do anything or not. The problem is that I can’t get the beginoverlap event to fire at all.
Right now I’m trying to set up the event with:
CollisionComp->OnComponentBeginOverlap.AddDynamic(this, &AFirstProjectile::OnOverlapBegin);
CollisionComp->OnComponentEndOverlap.AddDynamic(this, &AFirstProjectile::OnOverlapEnd);
In the constructor. And OnOverlapBegin is:
void AFirstProjectile::OnOverlapBegin(class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
{
Destroy();
}
(OnOverlapEnd is empty). This is just a quick example to make sure that the event was firing… and it’s not. I can shoot the projectiles and cause them to overlap, and they’re never destroyed, and the breakpoint I set in the C++ code is never hit.
The collision for the projectiles are:
This definitely made a change in behavior, as they will overlap in play now (ex http://i.imgur.com/HnWP11P.png ) instead of bouncing off each other as in the default template.
I also tried making a blueprint to accomplish roughly the same thing, which is not being fired either. I don’t know for certain that I set it up correctly, however, as I’m almost exclusively working with C++ for this. My attempt: http://i.imgur.com/uYRtf1I.png
The only info I’ve found on this from searching the web is to ensure that ‘Generate Overlap Events’ is checked in the collision settings, and it is. There are no compiler errors when I attempt to build/run this, the event is just never fired.
I’m still new to UE4 so it’s very likely I’m missing something obvious. What can I do to make this event fire properly?