Move ACharacter after it falls to ground


I have a ACharacter that is basically a copy of TopDownCharacter from TopDown example. I spawn it from C++ and assign an AIController to it. Then I try to call AIController::MoveTo and I want to see it walking towards given destination. The MoveTo call however returns fail, probably because at that time, the ACharacter is in the air and is not on navmesh yet.

I don’t really care where the ACharacter is, I only want it to start walking to given destination when possible. I would expect that there should be some kind of event that informs me about these changing states of the ACharacter. Something like OnEnteredNavmesh or OnTouchedGround.

How do I go about doing such thing? I don’t need it to go my way, I would appreciate a general knowledge of how to correctly perform the task of “going to given coordinates as soon as it is doable”.

Thanks in advance.

You can override the ACharacter::Landed function (event) and have the vector of the MoveTo attempt stored (and then call MoveTo from it)

Here’s it’s full signature :

void ACharacter::Landed(const FHitResult& Hit)

You could also bind a function to the ACharacter::LandedDelected multicast delegate (they need to have the same signature as the function above)

Great, I didn’t notice this method before. I ended up using Acharacter::MovementModeChangedDelegate in the end for that and it seems to work nice. Thank you.