OnComponentBeginOverlap.AddDynamic is not working?

HI All

I’m using 4.7.6.version now in unreal. I’m having a hidingpoint c++ class and using a boxcomponent in the class.I’m doing a delegate fn if a player overlaps with that Boxcomponent. I need to play a animation. I’ve created a function for playing a montage. In OnComponentBeginOverlap.AddDynamic is not working.

The code and the error is mentioned below:

BoxComponent = ObjectInitializer.CreateDefaultSubobject<UBoxComponent>(this, "BoxComponent");
RootComponent = BoxComponent;
BoxComponent->SetCollisionObjectType(ECC_Pawn);
/*BoxComponent->SetCollisionEnabled(ECollisionEnabled::QueryOnly);*/
BoxComponent->SetCollisionResponseToAllChannels(ECR_Overlap);	
BoxComponent->OnComponentBeginOverlap.AddDynamic(this, &AHidingPoint::CollideWithOther);

void AHidingPoint::CollideWithOther()
{

UWorld* const World = GetWorld();
for (FConstPawnIterator It = World->GetPawnIterator(); It; ++It)
{
	// Cast to the bots
	Bot = Cast<ASEAICharacter>(*It);		
}
FString name = Bot->GetName();
GEngine->AddOnScreenDebugMessage(-1, 5, FColor::Red, name);
Bot->PlaySneakMontage();

}

The error is
**error C2664: 'void TBaseDynamicMulticastDelegate::__Internal_AddDynamic(UserClass ,void
(__cdecl AHidingPoint::
)(AActor ,UPrimitiveComponent ,int32,bool,const FHitResult
&),const FString &)’ : cannot convert argument 2 from 'void (__cdecl AHidingPoint::
)
(void)’ to 'void (__cdecl AHidingPoint::
)(AActor ,UPrimitiveComponent
,int32,bool,const FHitResult &)’

Please help me with this issue

Thanks&Regards
Programmer

It looks like the error is trying to tell you that the argument list for the function you are trying to assign to the delegate is incorrect:

Where your function signature looks like this with no arguments:

void AHidingPoint::CollideWithOther() {

the delegate expects these as the arguments to the function you assign:

AActor ,UPrimitiveComponent ,int32,bool,const FHitResult &

So your code could be fixed by changing your function signature to the following:

void AHidingPoint::CollideWithOther(
	AActor* OtherActor,
	UPrimitiveComponent* OtherComp,
	int32 OtherBodyIndex,
	bool bFromSweep,
	const FHitResult & SweepResult) {