UPROPERTY(BlueprintGetter = Getter)
int var;
UFUNCTION(BlueprintCallable)
int Getter() const;
But I can still get the value of var by a direct reference to it in BP.
Because it is implicitly BlueprintReadOnly.
BlueprintGetter=GetterFunctionName
This property specifies a custom accessor function. If this property isn’t also tagged with BlueprintSetter or BlueprintReadWrite, then it is implicitly BlueprintReadOnly.
Similarly with BlueprintSetter.
So I don’t understand the purpose of designing these two Specifiers…
The node looking like direct access to the property now executes as your Getter method instead of directly getting the value. The phrase it is implicitly BlueprintReadOnly means that the setter won’t be accessible, while getter is your getter function.
Sorry for the late answer.
BlueprintGetter can be used when your member variable has private member access in C++ but you want to expose it to Blueprints.
In general you keep a member variable as private if you don’t want to give direct access to it (neither from C++ nor from Blueprints), but want callers (also from C++) to use the getter/setter methods. Such methods are useful - for example - to run checks on managed values, fire delegates on changes, add logging, modify later where/how the variable is stored (or how it’s computed), etc. You can read more about it here on Wikipedia.
The point of having a private member variable is that you don’t want to give direct access to it to other classes, including blueprints. Otherwise you would leave it as public. Using AllowPrivateAccess, while useful if you have old code where to moved a property from public to private, in general would invalidate this pre-condition. Having getter/setter instead allows your to run checks on returned and new values, fire delegates on value changes, add logging, change how/where the property is stored (or computed), etc. So, using BlueprintGetter and BlueprintSetter simply support this programming model, of course if this is what you want/need.
Setter is for when you want to be able to react whenever a blueprint designer sets your variable. For example in multiplayer online game you might want to call OnRep function for that variable being set, since you have to do it manually. You can simply get info back to code whenever a blueprint user sets or gets the variable and react to it however you want