Ok so i want to create a moving platform that when the player gets on top of it it starts moving up and when the player leaves the platform is stops moving!
!
This is the blueprint that i made and i want to make the same thing in cpp
These functions will be called when ANY component was overlapped in your actor.
I had a similar situation when I was making Capture Points and the Shape Component’s Overlap Event Signatures did not execute, so I solved it by using these functions.
A virtual function mean that it can be overriden in a derived / child class.
In this case NotifyActorBeginOverlap and NotifyActorEndOverlap is defined in AActor. So in order to change the logic of those functions in your child class you can override it providing it’s marked virtual.
Super::NotifyActorBeginOverlap means that we are executing all functionality that was defined in the parent AActor implementation. This is to prevent ‘loosing’ anything that happens in the parent AActor implementation.
And finally yes, if anything overlaps any component in your platform actor that is set to overlap, those functions will be called.
Unless I am wrong, in this instance, calling Super:: doesn’t do anything else than call a possible derived blueprint event of OnBeginOverlap? Seems that in most cases you’d prefer not to call it, because that event fires on its own as well, and calling the Super:: on C++ side will mean that the event will fire twice.