So I’m trying to bind to UPathFollowingComponent::OnRequestFinished, it needs 2 arguments:
FAIRequestID , const FPathFollowingResult &.
Here’s what I’ve done:
In my header I forward declare the appropriate types, and declare my method to bind.
struct FAIRequestID;
struct FPathFollowingResult;
UFUNCTION()
void OnMoveCompleted(FAIRequestID RequestID, const FPathFollowingResult& Result);
In my cpp file, I include the appropriate headers, and bind the method in beginplay:
#include "AIController.h"
#include "Navigation/PathFollowingComponent.h" //Where FPathFollowingResult lives
#include "AITypes.h" //Where FAIRequestID lives
/* in begin play ...*/
AAIController* AI = Cast<AAIController>(GetController());
UPathFollowingComponent* PathFollowingComponent = AI->GetPathFollowingComponent();
if (AI)
{
PathFollowingComponent->OnRequestFinished.AddUObject(this, &AFPSAIPatrolGuard::OnMoveCompleted);
}
My Problem:
I keep getting the following compilation error:
Unrecognized type ‘FPathFollowingResult’ - type must be a UCLASS, USTRUCT or UENUM.
EDIT:
I’ve dug into FPathFollowingResult declaration in the source files, and it’s actually not marked with a USTRUCT(), so the error message is just stating the truth, but if that’s the case, then what IS the problem here?
What I’ve tried:
EDIT: I’ve tried Including the headers in my header file and removing the forward declarations.
I spent 3 hours googling, and only thing that came up was this post:
I’m at lost here, anyone has an idea?