Blueprint Runtime Error: "Accessed None trying to read property Gamehud". Node: Show Restart Text Graph: EventGraph Function: Execute Ubergraph Info Blueprint: Info

Hello I am trying to show a Simple restart text trough my game HUD but I get this error. What am I missing?

This is the event in my gameHUD:

Game Hud

This is The box collision where I want to show the text:

Info (Box Collision)

And Now I get the error as the title states.

The Info hud is a variable of my Game hud

Any help will be appriciated

How do you reference Info HUD in the 2nd pic. Creating a variable that can point to a widget is not enough. Where is the widget?

  • where do you Create Widget
  • who owns the Widget Component if you’re using one?

Yes I created a variable in the second pic where I refrenced that to BP Game HUD. And I added the BP Game Hud to my viewport in the Gamemode BP

Could you show how you referenced it? From the descriptions it sounds as if you did not. How do you set the value of the reference variable you created?

Doing this:

Is not referencing. This just creates a variable that could potentially point to some widget. What if you had 14 widgets? Which one would you like to refer to?

I think that is what I did indeed. How do I need to do this in the correct way?

if you do this in the game mode:

You end up with this:

image

The game mode now stores a reference to that widget. Any other blueprint can now:

Could I add you on discord maybe? that would be easier fopr me to send pictures. or I could show my screen over a call if you would like?

Can’t do that, sorry. But you can paste images directly here.

Ok no worries. My ue5 is still starting up I will post the pics asap

1 Like

I mean, you have a solution above. Try it. Also:

Hey I am trying your Solution but I already have this in my game mode. If I add your part wont that mess things up?


Also this is how I refrenced the Variable:

The weird thing is I am also Using this game hud to show and hide interaction text somewhere else in my game and that seems to work just fine…

No, it will not. It’s actually necessary. What you have atm is not even OK. If you ever remove the widget from the viewport, it will get destroyed.

Also this is how I refrenced the Variable:

This is not referencing. This is just creating a variable. Imagine if you wanted to have some text, you create a variable for the text, but forgot to type anything…

You have a variable that could store text but we forgot to put it in.

So you say I remove the part I have right now?

No.

Just reference the widget correctly by assigning value to the variable.


like this?
Also should I change anything to the variable I sent before?

You do not need it, it has nothing to do with the widget unless you specifically set it to that widget. Ask the Game Mode to give you access, as in the 3rd pic I posted:

Any blueprint can now: hey, Game Mode, gimme access to the widget you created. You called it Hud Var.


Is this what you meant, because I tried it and it worked? Also, thank you so much for helping me. I know I am a complete noob!

1 Like

Looks great!

1 Like