forward declaration works fine with UCLASS-es, but I get the following compilation error when try to do it with USTRUCT-s (e.g.: “struct FRTSPlayer;”) to use them in other USTRUCT-s:
…Unrecognized type ‘FRTSPlayer’ - type must be a UCLASS, USTRUCT or UENUM
and several other error messages are coming, pointing to lines where that struct type is used, and compilation fails.
Another strange thing comes when I modify USTRUCT() to USTRUCT(BlueprintType), then the message above appears but the compilation is completed successfully, but only when the struct is defined in the header file containing a UCLASS. if it is in a separate file it fails.
I normally add new .h/.cpp files to the project by right clicking source folder or a subfolder in solution explorer, and select add item. I also add always the #include “…generated.h” line and macros properly. Basically, everything else works fine.
Maybe I do something wrong, or it would be better to use UObject in similar cases, when they should be referenced in other UStructs?