Accessed None Blueprint Runtime Error

Hi guys, I am trying to code a pause button into my game but I keep receiving the following error message:

However, the pause button doesn’t actually pause the game, and the progress bar keeps counting down.

The idea is that when I press the button in the top right corner, this screen appears:

And the progress bar at the bottom is paused. But when it is pressed, the timer continues as if nothing fired. I traced the issue back to this Set Pause node:

I have looked up this issue on Reddit and on other Unreal Forum posts and just don’t think I quite understand how to solve the issue.

Thanks in advance.

As the error says, your timer is not valid.

You need to instantiate it somewhere.

2 Likes

the error is telling that WBP Timer does not exist when you click the home button, so when you try to Set pause == true and Begin timer its impossible because you are trying to get properties from WBP Timer before setting what is WBP Timer.

try right clicking on a WBP Timer node and find references, down there in the find results tab you will see all references you are making to WBP Timer, notice in my second print there is a get WBP Timer, you should also have a SET WBP Timer in the blueprint, if you dont have the Is Valid? node from the first print will always output not valid.
the SET WBP Timer should be in the same place where you create the timer widget, you can drag a wire from the RESULT VALUE of the CREATE WBP Timer node and type set WBP Timer.

1 Like

So I went and set the WBP Timer when the widget is created.

I also went through and did what you did in your blueprint.

When I went to go and press the ‘Home Button’ again, the widget blueprint didn’t fire. Obviously that means my Set Timer node is definitely not valid somewhere, as rockenrock stated.

I thought maybe to put the Is Not Valid into the Set Timer, but that didn’t work either.

How would I go about making the Set Timer valid?

Thanks

How do you create the timer widget in the first place? The screenshots do not show it. Note how you call Create Widget node and add it to the viewport for other widgets. Who, where and when creates the timer? Assuming that the timer is a widget here.

Creating just a variable that can potentially hold a reference (WBP Timer) does nothing on its own. You need an object to exist, too. It’s a bit like giving someone an address of a house that has yet to be build.

1 Like

in you first screenshot you are setting WBP Timer by getting WBP Timer, this is basically setting the variable to be equal itself. what you need to do is CREATING the widget in the fisrt place, like you did in the Create “WBP Home Are You Sure Widget” node.

try doing it like this:

2 Likes

Thanks for the help and replies guys, I got a bit frustrated with the lack of progress so i stepped away from the project for a few days.

I copied what you did in your screenshot and that didn’t work. unfortunately.

However I went poking around with the variables and I found a little button called ‘Expose on Spawn’ which on each variable of WBP_Timer I switched on.

This button allowed me to reference the WBP_Timer in the Create Widget nodes and that somehow solved the issue!

1 Like