Download

problem with a struct

I can not not get this to compile. Says error : Unrecognized type ‘fAllRotation’ - type must be a UCLASS, USTRUCT or UENUM



struct fAllRotation
{
    //GENERATED_USTRUCT_BODY()
    TArray<FString> MapSettings;
};
UPROPERTY(globalconfig)
TArray<fAllRotation> Sv_MapRotation;


What is the proper way to get this working? I need the Sv_MapRotation set as a globalconfig property.

You are missing


USTRUCT()

before the struct keyword

does not work putting it there.

Have you tried like… I don’t know, googling it? It took me literally 2 seconds to look this up.

Structs

Using Structs

the answer is this

.

Sorry it bothers ya, That i asked a question?
What’s this forum for?

So what’s your point? does it just ■■■■ ya off that i did not google it? grow up!



#include "Engine/UserDefinedStruct.h"
#include "YourStructs.generated.h"

UCLASS()
class YOURAWESOME_API UYourStructs : public UUserDefinedStruct
{
     GENERATED_BODY()
};

USTRUCT()
struct FAllRotation
{
    GENERATED_USTRUCT_BODY()
    TArray<FString> MapSettings;
};


Thats how it work.
I didnt try but I think it wouldnt work with low register “f” for fAllRotation.

Thanks HorusWM

I looked back over my ustructs and see that I have both the USTUCT_BODY and GENERATED_BODY. I dimly recall reading that GENERATED_BODY could be used in all cases now.