UPROPERTY doesn't work with Blueprint properties

Hello, I’m stuck on a problem for hours now.
I want to make one of my variables from my c++ code readable in Blueprint (to make a health bar in a UI) using UPROPERTY. Everything is fine until I put a Blueprint property (like BlueprintReadOnly or BlueprintReadWrite), it makes an error that I can’t understand.
If someone can help, it will save me.

Here is my code without error :
image

The code with error :

The error :

1 Like

That error is shown in VS on the ErrorList tab but doesn’t tell much. In this case the Output tab usually generates a message telling exactly what is wrong.

If I have to guess, it shows because the UProperty is marked BlueprintReadOnly and is also private, which is unsupported.

2 Likes

Oh my god !!!
Thank you so much, it was just that. Now it works perfectly and I can continue, thank you again.

1 Like