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