I have a simple struct declaration in my .h:
FSpellBook DefaultSpellBook;
Which compiles just fine.
But I want to be able to set the variables within the struct in the editor, so I did this:
UPROPERTY(EditAnywhere) FSpellBook DefaultSpellBook;
Which does not compile, and instead throws this error:
error : In DMagicGameMode: Unrecognized type 'FSpellBook'
This is the struct:
USTRUCT(BlueprintType)
struct FSpellBook
{
GENERATED_USTRUCT_BODY()
UPROPERTY(EditAnywhere) int32 SpellSetCount;
UPROPERTY(EditAnywhere) int32 SpellsPerSetCount[5];
UPROPERTY(EditAnywhere) int32 SpellLevelMax;
UPROPERTY(EditAnywhere) TSubclassOf<class ASpell>InnateSpellClasses[3];
UPROPERTY(EditAnywhere) TSubclassOf<class ASpell>SpellSetClassesA[3];
UPROPERTY(EditAnywhere) TSubclassOf<class ASpell>SpellSetClassesB[3];
UPROPERTY(EditAnywhere) TSubclassOf<class ASpell>SpellSetClassesC[3];
UPROPERTY(EditAnywhere) TSubclassOf<class ASpell>SpellSetClassesD[3];
UPROPERTY(EditAnywhere) int32 UnlocksSetA[3];
UPROPERTY(EditAnywhere) int32 UnlocksSetB[3];
UPROPERTY(EditAnywhere) int32 UnlocksSetC[3];
UPROPERTY(EditAnywhere) int32 UnlocksSetD[3];
};
Any idea why adding a UPROPERTY() would cause the compile to fail?
Am I setting up the struct wrong? How do I fix this?