Hey guys, I think this may be a bug, but maybe not…
I currently have a UBoxComponent with an OnComponentBeginOverlap event. When I initially created the event I used a specific function name, now I’ve created a different function and when calling .AddDynamic with new function signature nothing happens. I can point to a new function or simply rename the function, either way, nothing happens unless I use the original function name. Here’s an example of both functions in my .h
UFUNCTION(BlueprintCallable)
void OnSuppressionBeginOverlap(UPrimitiveComponent* OverlappedComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& sweepResult);
UFUNCTION(BlueprintCallable)
void OnSuppressionBeginOverlapAlt(UPrimitiveComponent* OverlappedComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& sweepResult);
Now however only calling:
SuppressionCollisionComp->OnComponentBeginOverlap.AddDynamic(this, &AFPSTargetCharacter::OnSuppressionBeginOverlap);
Works. If I call .AddDynamic on the alt function:
SuppressionCollisionComp->OnComponentBeginOverlap.AddDynamic(this, &AFPSTargetCharacter::OnSuppressionBeginOverlapAlt);
Nothing actually happens.
For reference here’s each function implementation
void AFPSTargetCharacter::OnSuppressionBeginOverlapAlt( UPrimitiveComponent* OverlappedComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& sweepResult )
{
GEngine->AddOnScreenDebugMessage( -1, 2.f, FColor::Purple, TEXT("OVERLAP OG..."));
}
void AFPSTargetCharacter::OnSuppressionBeginOverlapAlt( UPrimitiveComponent* OverlappedComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& sweepResult )
{
GEngine->AddOnScreenDebugMessage( -1, 2.f, FColor::Purple, TEXT("OVERLAP ALT!"));
}
This is driving me completely insane and I can’t figure out why, any help would be great. Thanks!