Can't figure out this Blueprint Runtime Error, please help!

Hi!
I’m super new to the engine so i’m sorry if this is terribly simple, i’ve been trying really hard to figure this out but I just couldn’t, so I have tried new avenues of help by asking here!
(Thanks in advance for any input)


Ok so these are the errors.

Blueprint Runtime Error: “Accessed None trying to read property Unit”. Node: Set Spells List Graph: LinkUnitToSpellsList Function: Link Unit to Spells List Blueprint: ButtonList_Spells

Blueprint Runtime Error: “Accessed None reading structure Stats_8_37C8F658429D7C3252386687C4B9535B”. Node: Set Spells List Graph: LinkUnitToSpellsList Function: Link Unit to Spells List Blueprint: ButtonList_Spells

Blueprint Runtime Error: “Accessed None reading structure AvailableSpells_16_391243734F4B487FAECD49AE99631AA7”. Node: Set Spells List Graph: LinkUnitToSpellsList Function: Link Unit to Spells List Blueprint: ButtonList_Spells


The hyperlinks send me only to this function here.

I’ve done a lot of searching for people with similar issues but it seems this is a common/generic one ? I’m sure it’s something really silly, I just don’t have the skills to figure this stuff out yet.




Thanks in advance for your time!

an accessed none means that the object you are trying to get (in this case, the struct) doesn’t exist, or can’t be found.

In the pictures that you showed, I dont see where the struct and the structs owner is created?

Looks like the struct belongs to some actor called “unit.”

I’d start my search there. Put a breakpoint on that node so that when it fires, the game will pause and then you can check the value of the actor. Make sure that the actor is valid.

You can also do an is valid macro from the Unit reference and put a print string that say “Error: unit is not valid” on the false branch.

If the unit actor is valid then probably want to go into it and look at what is going on with the struct.

1 Like

Thank you for the reply, appreciated!

Ok, i’ll try this!

You mean like creating an Is Valid check in the blueprints to see if it makes sure the logic doesn’t run when the unit isn’t valid ?

what is calling LinkUnitToSpellsList(), and when is it being called?
what is Unit being passed as? (is this an Actor/Pawn or something that derives from one of those?)
it could be that whatever is triggering the LinkUnitToSpellsList() the Unit pointer has not been assigned yet, or it may have been called anything assigned at all.


pull out the given pointer/reference for Unit drop it, and type “valid” into the search box(the one with the “?” symbol has the branch built in, otherwise you would need to put it into a branch node anyways)

1 Like

in your case, you want to be alerted that the actor reference is not valid. So use a print string and add Error: as a prefix. That way it will be red and show up as an error in the output log.

Because your code depends on that reference to be valid in order to work, you do not want to allow it fail without notifying you.

1 Like

Perfect, I added a break to the “Link Unit to Spells List” node and found that the unit was valid the first time, but the second time it paused there it wasn’t, then i went backwards in the code and found it. Thanks!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.