# How can I get the “SelfActor” in OnBeginActorOverlap?

The signature it takes is

void ( AActor* OtherActor )


However, The actor that is handling this event is not involved in the overlap. How can I access the actor that owns this delegate? Assuming I can't store a reference to this elsewhere. Is there another delegate that takes that parameter? Is this reference stored in OtherActor somewhere?

Irritatingly, I don't believe there isn't a simple way (which is why most events in other frameworks have a sender parameter...). Instead, one way I've worked around is:

Bind to the collision event inside the actor that has the UPrimitiveComponent you want to listen to.

Create an event in that actor that others can subscribe to. But this event has the signature void (AActor* OtherActor, AActor* Sender).

When the first event is triggered, simply fire the other event, filling in this as the second parameter.

This also works in BP using event dispatchers.

• This workaround is a crap, but I'm not saying that you did any wrong, I mean Unreal should definitely add a sender. By the way, I also uses this workaround now... – Marson Mao Jan 27 '16 at 4:02

The actor that is firing the event is the current instance:

(this-> ) Will get you the actor that is firing the event.

(OtherActor-> ) Will get you the actor that it collided with.

• Like I said, the actor that is handling the event has nothing to do with the overlap. – Ben Mar 21 '15 at 14:22
• How does it have nothing to do with the overlap? It has to overlap with something in order to fire the delegate. – Steve Mar 21 '15 at 22:12