Expose the operation instead of the field
Designers can set the default and Blueprint can read it, but C++ still controls how the value changes.
UFUNCTION(BlueprintPure, Category = "Health")
float GetMaxHealth() const
{
return MaxHealth;
}
UPROPERTY(EditDefaultsOnly, Category = "Health", meta = (ClampMin = "1.0"))
float MaxHealth = 100.0f;
UPROPERTY(VisibleInstanceOnly, Category = "Health")
float Health = 0.0f;- Why
- Blueprint depends on
GetMaxHealth, not the way the class stores health. Validation or replication can change later without rewriting every caller. - Costs
- Every exposed function makes the Blueprint API larger. Treat its name and category with the same care as a public C++ method.
- Instead
- Use
BlueprintReadWritefor author-owned data whose direct mutation is part of the contract. UseVisibleInstanceOnlyfor runtime state that designers only need to inspect.

