OnComponentBeginOverlap.AddDynamic()

I try for character component but Add Dynamic makes error…
Help …

What error message are you getting compiling, if any?

UFUNCTION()
void OnBeginOverlap(UPrimitiveComponent* OnComponentBeginOverlap, UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult);

That’s not the correct signature. How did you get it?

Actually I did for component. not for actor

TheRightController = CreateDefaultSubobject(TEXT(“TheRightController”));
TheRightController->SetupAttachment(VRRoot);
TheRightController->SetTrackingSource(EControllerHand::Right);

TheRightController->OnComponentBeginOverlap.AddDynamic(this, &AVRCharacter::OnBeginOverlap);

“OnComponentBeginOverlap” definition gave me FComponentBeginOverlapSignature OnComponentBeginOverlap; then

FComponentBeginOverlapSignature definition has it’s argument

DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE_SixParams( FComponentBeginOverlapSignature, UPrimitiveComponent, OnComponentBeginOverlap, UPrimitiveComponent*, OverlappedComponent, AActor*, OtherActor, UPrimitiveComponent*, OtherComp, int32, OtherBodyIndex, bool, bFromSweep, const FHitResult &, SweepResult);

Your error says your function has an extra UPrimitiveComponent* parameter

// Signature
UPrimitiveComponent*, AActor*, UPrimitiveComponent*,...
// Yours
UPtimitiveComponent*, UPrimitiveComponent*, AActor*, UPrimitiveComponent*,...
1 Like

yeah it’s working

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms