Using unreals built-in C++ functions


I wondering… How do I correctly use the built-in functions of the engine in C++? I need to use the On Landed event in my character’s .cpp but I don’t know the correct format, how to implement it or if I need to do anything in the .h file. Can anyone please guide me through this?


If in doubt, consult the UE4 API.

On the far bottom, under References, is the header you need to include (unless you derive from ACharacter, then of course you don’t need that)

Otherwise it’s just a normal function call like every other.

As API refrecne suggest best will be use of this insted:

It a virtual function so all you need to do is override it. In h:

virtual void OnMovementModeChanged(EMovementMode PrevMovementMode,uint8 PreviousCustomMode) override;

Then you define function in cpp like any other function, but remeber to call on Super in it or else you gonna block code of ACharacter:

Super::OnMovementModeChanged(PrevMovementMode, PreviousCustomMode);

Alright! Thank you very much :slight_smile:

Ah, I see. This information was extremely useful to me as I pretty much just started coding for UE4, thank you! :slight_smile: