Unrecognized type 'FJsonObject' - type must be a UCLASS, USTRUCT or UENUM
Hello, I've got an error when compiling my custom blueprint nodes and I can't understand how to solve it.
So I made plenty of custom BP Node cuz I prefer scripting in Blueprints and I often need functions that does not exist in bp and I found out that the only ones that work are those that return "normale" types (Like bool, float, etc.)
As soon as I try to make them return me a more complex type defined in libraries (that I ofc include) this is error is popping up and I can't compile the header (.h) file.
the full error is : Unrecognized type 'FJsonObject' - type must be a UCLASS, USTRUCT or UENUM
which brings me to the line : static FJsonObject CreateJsonObject();
The full code is
Thanks for your time :3
UE4's reflection system requires references, declared by the UFUNCTION/UCLASS/USTRUCT/UENUM macros, to be derived from UObjects. Your functions are returning/taking FJsonObject, which does not inherit from UObject. If you want to use FJsonObjects with the reflection system or blueprints you're going to have to make a wrapper class that inherits from UObject. Vladimir Alyamkin wrote a pretty good plugin for blueprintable json objects that you can find and refer to here.
Follow this question
Once you sign in you will be able to subscribe for any updates here