Can't access protected members of struct in the struct's constructor

USTRUCT(BlueprintType)
struct FWeaponInfo
{
GENERATED_BODY()
public:

protected:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "WeaponInfo")
	float WeaponRange;


	FWeaponInfo()
	{
		WeaponRange = 2000.f;

	}

};

I get the following errors:

Severity	Code	Description	Project	File	Line	Suppression State
Error	C2248	'FWeaponInfo::FWeaponInfo': cannot access protected member declared in class 'FWeaponInfo'	ProjectGalaxy	z:\program files\epic games\ue_4.15\engine\source\runtime\coreuobject\public\UObject\Class.h	574	

I’m trying to initialize variables in my constructor of the struct, but it’s saying I can’t access protected members in my constructor. ??? I’m confused

NEVERMIND! I didn’t realize my constructor was under the protected section. Whoops

I didn’t realize my constructor was under the protected section.

Nerver look at error section in visual studio, but always at the output log, that’s where the real compile errors are ! :slight_smile: