Accessed None Trying to read property Problem

I am trying to add health by consuming an Apple but I’m getting the Accessed none error on my W_Health_Stamina veriable and I am unable to solve this myself. Am I doing it the right way here?



Did you pass in the reference to the variable W_Health_Stamina after spawning your health stamina widget?

Thw variable itself is null and useless until its populated.

Yes I think I did that right? I am fairly new so trying to understand what everything means.
2024-06-27 20_13_06-Window

That is an empty variable of the type W_Health_Stamina

You still need ti create the widget at some point and then pass on the widget instance to that variable for it to be set

Think of it as an emty bag with the printed label W_Health_Stamina.
You still have to go to the shop, buy the widget and put it in the bag to be able to later take it out of the bag at a later stage.

1 Like

So I do create the widget here in my Player character but I am trying to use its update health function in my Effect_Healplayer
2024-06-27 20_22_45-Window

I would suggest making a blueprint class based on HUD and putting your widget logic there.

You can later on use “get hud” command in classes.
Best to add an interface to the hud for setting parameters

The you can just call “get hud” => setHealth(value) and it should call the blueprint interface function that will control the spawned widgets in the hud class.

There is a reason thete is a Hud class in the game mode.

1 Like

Ah got it! I do have an HUD I will try this, thank you so much.