Getting "Accessed None" error and I'm not sure what the cause is

It means you tried to use a variable or argument and it hadn’t been initialized to anything. You can try clicking on the link in the message log and it usually (but not always) will take you to the place in your blueprints where it happened. Otherwise you will just need to use the debugger to track it down. Look for a get node followed by a function call or another get that links off of it where the first get returned a None.

If any Epic staff are reading this, please add a feature request to add an option to break in the debugger whenever this happens.

Yea I’ve filed a bug report on that earlier this week. It is probably in that same blueprint not too far away though. The only thing I see in your BPs there is that perhaps “ScoreText” was never assigned.

That or the event is somehow called with nothing passed in for the block. You can try adding some IsValid? checks to the code and see if the problem clears up.

Hi all,
I’m trying to create a small sliding puzzle game from the puzzle template and I already succeeded into making the game works using blueprints, although they are not very clean and still need some work.
The problem is every time I run my game I’m getting arround 140 of these “Accessed None” error which I think doesn’t even point me into the right direction and I’m not sure what the source of my problem is.
If I click on one of the actors on the screen before the errors appear on the log and actor disappear, If I wait then the game works correctly.
I’m adding screenshots of the errors and my main game logic. I hope someone can help me find the cause for these errors or at least show me a good way to find it.

Thanks in advance,

Amit

The link takes me to a “Return Node” from a function that only gets called when I click on one of my actors, so its not very helpful :frowning:

I’m not sure that’s the cause, that part is taken from the template, I haven’t changed it

Yep, i guess you try to use a reference variable that is still NULL. Make sure the variable you use can’t be NULL. Either by using “IsValid” node with it or by making sure that you filled it before it is used.

A variable that takes in an actor(object) is something different than an int variable. It cann be empty and if you try to use some from this variable, although it is still NULL, you will get this error.

Look at what Variable causes the error and use the IsValid node. If the error disappears, then try to look if the variable is already set to something before using it.

Sometimes you can call function before the actors is initialized. So waiting a few secs will make sure that everything works (loading screens etc).

ok, so I finally found the cause to the problem, I was hoping that someone could explain to me why it behaves the way it does, perhaps its another bug?
so if you look at the clickLogic 1 and 2 screenshots you will see that I have a timeline I use for moving the blocks after they are clicked, this happens on a custom event sent from the block’s touch handler.
The problem was that I set the timeline to autoplay which made it start without the event being called and thus running the set Actor Location on a None Actor.

I’m not sure what Autoplay was supposed to do in this situation but it makes the bug in my blueprints really hard to track down.

Does someone have a good explanation?

Had to learn it the hard way :slight_smile:

Autoplay means you want it to run as soon as the level is loaded. So don’t use Autoplay if everything isn’t ready to go at the start.

I just fixed 20,000 errors i had by using, is valid check! thanks a million!
=)
-Samuelb