Accessed none trying to read property

Hello, I am new to Unreal and have been relying on a tutorial in order to make an inventory and crafting system, with a merchant here is the link [Eng] Slot-based Inventory System: Throwing away multiple items #010 - YouTube .Now in the compiler it is saying everything is fine yet when it is tested these errors come up, now I have checked and the apparent fix is to use is valid before the error. This has been done and yet the error is still there which leaves me slightly confused as how to fix this.On a related side note I technically have got rid the issue, with regards to the first person character section. Through using this fix yet since being used, I can no longer access in game the affected section. I believe that is the second error screenshot if that helps.
Any help is appreciated

alt text

These are all improper reference errors. Your variables that are throwing errors are most likely empty containers without any prior “Set” node to create an actual reference to an instance of the object. For help with proper casting and creating references check out video #1 (Casting) and video #25 (Creating References). Hopefully that will help you figure out where your issues are coming from and how to fix them.

Hello thanks for the quick reply been looking through the tutorials and I think I understand. I am guessing that I replace the is valid with get actors and cast to?

You need to create a reference to an actual instance of “Storage Actor” and then use a “Set” node to make the variable “remember” that reference. Then you won’t get an “Accessed None” error.

Hello it would appear to be working mostly, though a few of them when this method is attempted create a blueprint error, as shown in the new screenshots. I cannot understand what is causing these errors as the target needs a connection, should have a connection to the first person character albeit not as quickly accessible, as their is an additional node in between. The solution to this problem, appears to be to connect the get inventory ref to the hide inventory error, but this leads to the access none returning.

You’re not making the correct references…the first person character you can get a reference to by using the node “get player character”. The “get all actors of class” is over kill and not even connected.

I have tried implementing it in both screenshot locations in the latter screenshot it can only connect with the character movement, and the is valid statements and is still causing the access none error. As for the former screenshot the it couldn’t connect to anything due to it being a character reference, rather then a first person character reference, even though they should be the same thing. Outside of this the only thing I can connect it to that makes any sense to is a cast to. Which leads to roughly the same result as the get all actors chain causing the same bug. As such could you please explain on where or how I should put this get player character.

Try replacing the variable “First Person Character” with the following nodes:

Get Player Character → Cast To First Person Character

Use the output pin from the cast node to grab the inventory.

Also, I see another issue. You can’t cross execution paths!! Do not take a path where you create the FPC reference and plug its inventory into a set node and use it in the second execution path. When the second path executes it will trace back to the first path to find that reference and not find it giving “accessed none” because path 1 didn’t execute when path 2 did. Make the references separate. No white lines should go vertically only horizontally along a chain. NEVER CROSS PATHS.

facepalm Now you are trying to get a reference to the inventory from a cast node that isn’t executed… You need to have the cast node in the line of execution where you use its reference. So after “Add to ViewPort” should be “Cast to FPC” and then “Hide”

Tried implementing that as shown in the screenshot and it has led to an additional error, which I think has appeared before around one of the character movement screenshots. I also tried changing the inventory ref to a set rather then a get to the same effect.

Thank you the error connected to screenshot 5 and I believe 3 has now been fixed, still have an issue with the error in screenshot 4.Trying to use this method to resolve it doesn’t appear to work, as the get first person character connected to the merchant doesn’t create an input and output pin. Though others do but won’t connect to nodes in the merchant and using a set leads to the error continuing.

Honestly, you have some mad spaghetti code going on up there is is hard for me to see where execution starts and ends for each path. Your errors are all due to trying to grab the wrong references from the wrong or unconnected nodes. If you can post it somewhere like this website https://blueprintue.com/ I think it allows us to scroll through your blueprint graph then I could get a better idea of what your issue is

here is the link the section with the error is near the end

So you have a bunch of “Set” nodes with no input…You can’t remove “shop widget” using a reference variable and then “set” it with nothing afterwards. You need to “set” any variable FIRST then you can use it. You also don’t need to “cast to first person” every time you need to use something from it. Do it once, save the output as a reference variable and pull from the reference. On one of those places where you cast multiple times back to back, you hide your inventory then immediately show it…that makes no sense. Why even bother hiding it??

Haha glad it solved some issues. You don’t have to leave this “unresolved” by the way, you can still post more comments even if you mark it solved. I will still get notifications. It is preferable if this method solved your issue as far as you know to make this resolved so that others can know this worked. If something comes up later feel free to continue the discussion.

Thank you that appears to have resolved the access none issue. I will leave this question thread as unsolved in case of further issues that the previous methods cannot resolve. As for the showing and hiding inventory it was done in the video link provided around the 35 minute mark, I assume he was trying to do a sort of inventory refresh, in the event that the player inventory was opened when using the merchant.

Hello was going through trying to fix the errors, and I appear to have found one that occurs when I try to fix it around arrays. As shown in the screenshots, trying to use a make array as suggested on screenshot 8 doesn’t connect to the get reference already in place, and trying to follow through from the set node doesn’t appear to work. Outside of this screenshot 7 leads to 6, which is confusing as I have never interacted with the standard macros, and so why it is triggering there rather then the actual changed area is confusing.

There should seriously be a compile time error that prevents this for the number of people that attempt to use unconnected nodes…facepalm Of course you’re going to get errors like this. Just hook up your cast nodes and this will all go away :slight_smile:

Thank you that error has now been fixed, as for the unconnected nodes error I think they tried that in one of the later version, in that it would present a warning when the input and output nodes weren’t connected. Outside of this I am noticing a strange error, in that I cannot call the actual section of code to function when testing. Their is no error codes being generated, I initially thought this was an issue with using the is valid patch up but that doesn’t appear to be the case.
here is a link to the relevant blueprint with the main areas being the C and I lines I am aware that the I lines still causes the access none error still trying to figure out how to fix as trying to use what was done for C hasn’t worked, and if it did I suspect it would generate the same problem. As that to had an access none connected to the visibility before the no error code error occurred.