Setter-Getter functions in Unreal Engine C++



This will expose the variable Value to Blueprints despite being private and each time it is modified in Blueprints it will invoke the setter getter functions

public:
    UFUNCTION(BlueprintSetter)
    void SetValue(int NewValue);

    UFUNCTION(BlueprintGetter)
    int GetValue() const;

private:
    UPROPERTY(EditAnywhere, BlueprintSetter=SetValue, BlueprintGetter=GetValue)
    int Value = 10;