A way to override or bind OnMoveCompleted inside pawn class?

Is there way to override or bind to event aicontroller->onmovecompleted event inside pawn class?

Bind a delegate called OnRequestFinished in BeginPlay()

AAIController* AIC = Cast(GetController());

AIC->GetPathFollowingComponent()->OnRequestFinished.AddUObject(this, &YourPawnClass::YourMethod);

The method have to take 2 parameters FAIRequestID and const FPathFollowingResult&

OnMoveCompleted Delegate is deprecated, Use OnRequestFinished instead

3 Likes

If still relevant it is possible to override AIController->OnMoveCompleted() as it is a public virtual function.

So create your own child the from the AIController class then create following:

.h (public)
virtual void OnMoveCompleted(FAIRequestID RequestID, const FPathFollowingResult& Result) override;

.cpp
void AYourAIController::OnMoveCompleted(FAIRequestID RequestID, const FPathFollowingResult& Result)
{
UE_LOG(LogTemp, Warning, TEXT(“OnMoveCompleted_Override”));
}