OnLanding in C++

Hi Guys!
I’m struggling with the following. I wanted to set a bool after my Character lands. Therefore I found the ACharacter::OnLanding function. But I can’t figure out how to implement it in code. Here is what I want to do in Blueprints.
Unbenannt
The HitResult is not important for me, I just want to set the bool when Landed.

.h:

void Landed(const FHitResult& Hit) override;

.cpp:

void AMyCharacter::Landed(const FHitResult& Hit)
{
    Super::Landed(Hit);
    bIsFallingAfterFlying = false;
}
2 Likes

Thanks! But how do I use it then? Because now it looks to me that this is just a function that I can call. Like this

FHitResult LandedHit;
Landed (LandedHit);

But this would just immediately set the bool false and not when the character lands. I dont understand where the requirement of landing comes from :melting_face:

The function is called by the character automatically. The functionality is already there in the engine, you just override the function so that you can have your own additional functionality.

Ohh okay, thanks again!