every thing under GENERATED_BODY() are private by default.
UCLASS()
class TUTORIALCODE_API ABatteryPickup : public APickup
{
GENERATED_BODY()
/* Set the amount of power the battery gives to the player */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Power)
float PowerLevel; // **------------------------<<private>>-----------------**
/*Override the OnPickedUp function (use implementation because this is a BlueprintNativeEvent)*/
void OnPickedUp_Implementation();//**----------------<<private>>----------------**
};
and BlueprintReadWrite can not be in private section.
you must modify your code and write every declarations that have BlueprintReadWrite macro under public: or protected:
as below:
UCLASS()
class TUTORIALCODE_API ABatteryPickup : public APickup
{
GENERATED_BODY()
public:
/* Set the amount of power the battery gives to the player */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Power)
float PowerLevel; //public
/*Override the OnPickedUp function (use implementation because this is a BlueprintNativeEvent)*/
void OnPickedUp_Implementation(); //public
};
in battery collector tutorial Ms Lauren Ridge mentioned to reasons of using private, protected and public keywords if you pay more attention you will find out.