"Type must be a UCLASS, USTRUCT..." - thx, but it is

Hi everyone,

I think I’ve come across a weird C++ bug in UE4. I’ve included…

#include “Navigation/PathFollowingComponent.h”

… in custom (and otherwise working!) UObject in order to use FPathFollowingResult in a method. Context: I’m trying to bind to AIController’s OnMoveCompleted(FAIRequestID RequestID, FPathFollowingResult& Result). The method is a UFUNCTION(BlueprintNativeEvent, BlueprintCallable).
FAIRequestID doesn’t throw this error, it’s only FPathFollowingResult.

Is there any way to fix this or do I have to change my code?

Thx! :slight_smile:

Hello! FPathFollowingResult is not USTRUCT, it is simple struct. Maybe you are using dynamic delegate? If yes, then you can try to change it to nondynamic one.

Hi!
Thank you for the fast reply!
That’s unfortunate… I really thought that FPathFollowingResult was a USTRUCT.

I’ve also found out that I got the exact same error when not binding/using the function at all. The mere existance of…
UFUNCTION()
void MovementFInished(FAIRequestID RequestID, FPathFollowingResult);
… led to the error. Deleting the UFUNCTION() macro above MovementFinished(…) gets rid of the FPathFollowingResult error, but then I get “Links from ‘AddDynamic’ have to be in one Class/Struct/Union” [rough translation].

The same happens if I try to bind with .BindStatic(…).