I’m trying to create a custom struct, to ensure I understand the syntax:
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class LEARNINGPROJECT_API UTestComp: public UActorComponent
{
GENERATED_BODY()
public:
// Sets default values for this component's properties
UTestComp();
// Called when the game starts
virtual void BeginPlay() override;
// Called every frame
virtual void TickComponent( float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction ) override;
FTestStruct myStruct;
};
USTRUCT()
struct LEARNINGPROJECT_API FTestStruct{
GENERATED_USTRUCT_BODY()
UPROPERTY()
float testFloat;
};
I don’t get any errors within the struct declaration itself, but I get four errors on the “FTestStruct myStruct;” line, two identical pairs of:
Missing ‘;’ before identifier ‘myStruct’
missing type specifier-int assumed.
I’m assuming this has something to do with my messing up the struct declaration, but the syntax looks like it matches the tutorial I was following at A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums , so I’m not sure where I should begin debugging.