Game Coding – UE4 Accessing a UPROPERTY from Blueprints

The member must be exposed as a UPROPERTY on the member variable that you want to access from your Blueprints diagram. You must qualify the UPROPERTY in your macro declaration as being either BlueprintReadOnly (This property can be read by Blueprints, but not modified) or BlueprintReadWrite ( This property can be read or written from a Blueprint). You can also use the special value EditDefaultsOnly to indicate that you only want the default value (before the game starts) to be editable from the Blueprints editor. EditDefaultsOnly indicates the data member cannot be edited from Blueprints at runtime.

UPROPERTY are automatically written Get/Set methods for UE4 classes. They must not be declared as private variables within the UCLASS, however. If they are not declared as public or protected members, you will get a compiler error.