I get compiler errors when UPROPERTY(BlueprintReadWrite) or UPROPERTY(BlueprintReadOnly)

I get this error message when I am trying to use UPROPERTIES with any Blueprint Command.
EditAnywhere works fine but there is something with BlueprintReadWrite and BlueprintReadOnly


Thanks for any suggestions or help!!

This error just says compilation failed. Look in the output tab for the actual error

The solution was to move it out from private to public or protected

You can also keep it private in C++ and add meta = (AllowPrivateAccess = "true") allowing Blueprint to read and/or write it.

really okay thx, Im new so dont know what works and what dont, but thx!

Just because you can doesn’t mean you should. Having blueprints write to a private variable is a bit weird since when you make something private you don’t want anyone outside to change it. Allowing blueprints to read it is more acceptable though so you can see it exists in Blueprint and use it.

1 Like