I created a AGhostActor (AActor) in C++ and registered for OnComponentBeginOverlap and OnComponentEndOverlap events:
CollisionShape->OnComponentBeginOverlap.AddDynamic(this, &AGhostActor::OnBeginOverlap); CollisionShape->OnComponentEndOverlap.AddDynamic(this, &AGhostActor::OnEndOverlap); CollisionShape->bGenerateOverlapEvents = true;
I also set “Generate Overlap Events” Flag on an Cube (StaticMesh) in my level (Level was generated by the C++ TopDownExample). The OnComponentBeginOverlap event is calling correctly. But I never got a OnComponeneEndOverlap event.
So I checked the source file PrimitiveComponent.cpp. If I’m right, the method UPrimitiveComponent::EndComponentOverlap is responsible for creating the end overlap event for components. There is a check if other actor exists (see if (OtherActor)) and only then the event will be fired.
And for my case, where I’m trying to get this event for staticmesh (has no actor as parent) and a actor, I never got the end overlapping event bcuase the staticmesh do not have a actor as parent.
For me it looks like a bug. But maybe I’m doing anything false. So maybe someone can help me with my issue.
I also check this OnComponentEndOverlap | Unreal Engine Documentation and some other users question and couldn’t find a answer.
Thank you in advance