# Why are BlueprintGetter not visible?

**URL:** <https://forums.unrealengine.com/t/why-are-blueprintgetter-not-visible/579329>\
**Category:** C++\
**Tags:** ufunction, unreal-engine, UE5-0, question\
**Created:** [June 11, 2022, 9:47am UTC](https://forums.unrealengine.com/t/why-are-blueprintgetter-not-visible/579329 "2022-06-11T09:47:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![DevKaiUnreal](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/devkaiunreal/32/935713_2.png) [@DevKaiUnreal](https://forums.unrealengine.com/u/DevKaiUnreal)\
**Post date:** [June 11, 2022, 9:47am UTC](https://forums.unrealengine.com/t/why-are-blueprintgetter-not-visible/579329/1 "2022-06-11T09:47:21Z")

</div>

Hi,

I tried to implement BlueprintGetter in `UHealthComponent : public UActorComponent`, but I am not able to call it from the Blueprint (see Screenshot):

 ![UActorcomponent-BlueprintGetter-accessible](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/2/c/72c90551ca81809cea6aaa05436ede2384f5d1d0.png)  
I also tried closing and re-opening, clean re-built and directly in an _ACharacter_-derived class instead of a _UActorComponent_ . Unfortunately without success.

According to this site [https://unreal.gg-labs.com/quick-reference/the-ufunction-macro](https://unreal.gg-labs.com/quick-reference/the-ufunction-macro):

> BlueprintGetter  
> This function will be used as the accessor for a Blueprint-exposed property. This specifier implies BlueprintPure and BlueprintCallable.

I’d really like to follow encapsulation principles (instead of _AllowPrivateAccess_). Am I missing something or might that be a bug?

Thanks!

---

<div class="post-metadata">

**Author:** ![eldany.uy](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/eldany.uy/32/821920_2.png) [@eldany.uy](https://forums.unrealengine.com/u/eldany.uy)\
**Post date:** [June 11, 2022, 11:06am UTC](https://forums.unrealengine.com/t/why-are-blueprintgetter-not-visible/579329/2 "2022-06-11T11:06:00Z")

</div>

User BlueprintReadWrite for the UPROPERTY and BlueprintCallable for the UFUNCTOIN

---

<div class="post-metadata">

**Author:** ![DevKaiUnreal](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/devkaiunreal/32/935713_2.png) [@DevKaiUnreal](https://forums.unrealengine.com/u/DevKaiUnreal)\
**Post date:** [June 11, 2022, 12:59pm UTC](https://forums.unrealengine.com/t/why-are-blueprintgetter-not-visible/579329/3 "2022-06-11T12:59:06Z")

</div>

Sorry but how is this an answer to my question? With `BlueprintReadWrite` you are breaking encapsulation. Encapsulation is important to hide implementation details and to write clean interfaces between classes and users of the class. I intended to use a `BlueprintGetter` to follow such software design principles.

---

<div class="post-metadata">

**Author:** ![eldany.uy](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/eldany.uy/32/821920_2.png) [@eldany.uy](https://forums.unrealengine.com/u/eldany.uy)\
**Post date:** [June 11, 2022, 1:28pm UTC](https://forums.unrealengine.com/t/why-are-blueprintgetter-not-visible/579329/4 "2022-06-11T13:28:38Z")

</div>

right…ok…sorry to try to help

---

<div class="post-metadata">

**Author:** ![DevKaiUnreal](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/devkaiunreal/32/935713_2.png) [@DevKaiUnreal](https://forums.unrealengine.com/u/DevKaiUnreal)\
**Post date:** [June 11, 2022, 1:41pm UTC](https://forums.unrealengine.com/t/why-are-blueprintgetter-not-visible/579329/5 "2022-06-11T13:41:18Z")

</div>

Sorry I did not want to sound rude. Thank you for trying to help!

---

<div class="post-metadata">

**Author:** ![JoSf](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JoSf](https://forums.unrealengine.com/u/JoSf)\
**Post date:** [June 12, 2022, 2:32pm UTC](https://forums.unrealengine.com/t/why-are-blueprintgetter-not-visible/579329/6 "2022-06-12T14:32:35Z")

</div>

BlueprintGetters are more like overrides for the standard get method of BlueprintReadOnly variables. This allows you to make the additional checks or replication or whatever is necessary.

The UPROPERTY() is already implicitly BlueprintReadOnly when using BlueprintGetter = FunctionName.

Following from that, to “get” the variable in the blueprint graph with your current setup you would search for Alive, not IsAlive.

Though, if you used the coding standard, the variable would be named bIsAlive and the function name would be GetIsAlive.

---

<div class="post-metadata">

**Author:** ![DevKaiUnreal](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/devkaiunreal/32/935713_2.png) [@DevKaiUnreal](https://forums.unrealengine.com/u/DevKaiUnreal)\
**Post date:** [June 14, 2022, 12:13pm UTC](https://forums.unrealengine.com/t/why-are-blueprintgetter-not-visible/579329/7 "2022-06-14T12:13:36Z")

</div>

> Following from that, to “get” the variable in the blueprint graph with your current setup you would search for Alive, not IsAlive.
> 
> Though, if you used the coding standard, the variable would be named bIsAlive and the function name would be GetIsAlive.

Good to know! Also thanks for the hint to the naming convention. I just compiled the following, ignoring the naming conventions deliberately to test if Unreal derives any logic from it, which not seems to be the case:

```auto
public:
	UFUNCTION(BlueprintGetter)
	int GiveMeFoo() const { return Foo + 1; }

private:
	UPROPERTY(BlueprintGetter=GiveMeFoo)
	int Foo = 42;

```

No matter how I name the getter, the variable is accessed via **Get Foo** as you pointed out with “overrides”.  
 ![BlueprintGetter](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/c/b/8cb7f3cf9da4e993a1974787b5548f20cb1e148a.png)  
Thanks a lot! 🙂
