How to use OnActorBeginOverlap c++ code?

You might not be calling a member function. You might be calling another system’s function or another instance. You can call anything you want. The design is flexible that way.