Hi
I have a problem with my destructible Actor, I’m unable to bind the onHit function.
Here is the code, it is not the complete class, if you miss relevant parts please let me now.
public:
UFUNCTION()
void OnHit(UPrimitiveComponent* HitComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit);
CPP
void AObject::BeginPlay()
{
Super::BeginPlay();
GetDestructibleComponent()->OnComponentHit.AddDynamic(this, &AObject::OnHit);
...
}
void AObject::OnHit(UPrimitiveComponent* HitComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit)
{
UE_LOG(LogTemp, Error, TEXT("HITTTTTTTTTTT"));
}