Download

PostInitProperties and Constructor is being called 4 times on change of a Default Value

​Hello,

I have an Health (UActorComponent) attached to an actor in the blueprint. This Health Component has an exposed DefaultHealth Variable. I have implemented the PostInitProperties as shown below: b9043db0825dc2fda5ae0eb6ca21c0f4c32c63a0.png

https://forums.unrealengine.com/core/image/gif;base64

And here’s the image of the Blueprint Components and Details Tab 5b9f2b3e449df48458fe07a40820d34836cd9fc7.png

![Annotation 2020-07-24 180101.png|415x180](upload://uUksibrHBo3CtzYTPtZSnP0K0mE.png)

Whenever I change the value of Default Health and Save the Constructor and PostInitProperties run 4 times, even though the Actor is not placed in the world nor will there be multiple instances of the Actor created during gameplay.

FYI: I am on UE 4.25.1

You should initialize variables in the constructor.

The problem with initializing in the constructor is that CurrentHealth value will not reflect the change in value of Default Health done in blueprint.
The Current Implementation is working fine functionality wise, but it gets called 4 times on change of the Default Health. Is this a bug?