How do I find out how to use OnComponentBeginOverlap?

I am doing the UE multiplayer course and the lecuatuer goes to the documention and finds the code to use the event OnComponentBeginOverlap. In UE5 the documentation has changed and is says this is the syntax:

FComponentBeginOverlapSignature OnComponentBeginOverlap

I don’t see how this helps me, a least not on its own. Is that all the information I need to figure it out? If If see something with similar syntax, for example OnComponentEndOverlap. How am I suppost to work out the code for it? Does this mean anything to you, is there something I should know and am missing out that could make the synax tell me all I need to know?
How am I suppost to find the code if I see an event like this and want to use it?

This is one of my biggest annoyances with the engine. The easiest way is to understand these signatures is to actually look at the engine code. If you can find FComponentBeginOverlapSignature then it’ll give you a clue as to what the method signature is. The next bit is interpreting this. If you have the engine symbols installed and you are using visual studio, you can search for the struct and press F12 to navigate to the definition and it should help you.

Of course, this doesn’t work if you don’t have the source, like me. Anyway, the other way to deal with it is to peek at the lecture changes and get the signature. Anyway, this is what I have from my source:

void classname::OnOverlapBegin(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor,
  UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)

I wish I could say there’s an easier way for C++ but there isn’t really. The documentation was good but at some point it became really bad, about 4 years ago I think.

I hope this gets you unstuck. I would suggest installing the symbols if you have enough disk space so you can track this down via the source.

1 Like

Thank you this is helpful. I am able to find the signature with visual studio as you suggested.

1 Like

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