FCollisionQueryParams unrecognized when using UFUNCTION

I have a static function in a subclass of UBlueprintFunctionLibrary. The declaration looks like

static void TestFunction(FCollisionQueryParams test);

This compiles perfectly well. However, as soon as I add a UFUNCTION macro in front of it, the compiler complains that FCollisionQueryParams is an unrecognized type. Is this because it’s not a USTRUCT? FVectors aren’t either, and they seem to work fine…

They must be USTRUCT to be used as UPROPERTY or within UFUNTION, FVector is special type and handled directly by the UHT (Unreal Header Tool) I guess. You also got the compiler errors when you are generating headers which is one step before you are actually compiling your code.

You could create an USTRUCT that holds the required data and then create a FCollisionQueryParams on the fly in those places where you need one.

Thanks, that clear things up a lot :relaxed: