In my Weapon.h
I am trying to have a USTRUCT
above my UCLASS
, but I am getting various errors.
First, its telling me in my USTRUCT
for GENERATED_BODY()
: This declaration has no storage class or type specifier
Then at my UCLASS
it says the same thing for UCLASS
Here is the code:
#pragma once
#include "GameFramework/Actor.h"
#include "Weapon.generated.h"
USTRUCT(BlueprintType)
struct FWeaponData
{
GENERATED_BODY() // GIVES FIRST ERROR
/* Bunch of UPROPERTY STUFF */
};
UCLASS() // GIVES SECOND ERROR
class THIRDPERSONCPP_API AWeapon : public AActor
{
GENERATED_BODY()
/* Buncha UFUNCTIONs and UPROPERTY stuff */
};
How can I fix this so that I can use USTRUCT with my UCLASS ?
I tried searching previous questions and people said that they were able to ignore the error and run it, but I can’t do a build because of the errors. I tried doing a clean and then a build, but to no avail.