Announcement

Collapse
No announcement yet.

Blueprint Runtime Error: Accessed None

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Blueprint Runtime Error: Accessed None

    Hi i am attemting to create Slots for an inventory System i am Having This problem :

    Blueprint Runtime Error: "Accessed None trying to read property Inventory_Component". Blueprint: Inventory-Grid-Widjet Function: Execute Ubergraph Inventory- Grid- Widjet Graph: ForLoop Node: Branch
    Attached Files

    #2
    it seems to me like slot index problem but i am not sure

    Comment


      #3
      This means that while your program runs one of the function called returns the equivalent of NULL or nothing, yet your code tried to work with it nevertheless. Instead of crashing like a C program would do, UE reports this runtime error. I don't know which one but the slot content or inventory object references are probably at fault.
      You have two ways of handling this: Either add an "IsValid" node and only proceed if the returned reference is valid, or check where the object you want to access comes from and see if you are doing something wrong there. It depends whether a null return value is expected behavior or not. If you say that every character must have an inventory no matter what, you should look at the second solution and see why this one does not return an inventory (or slot), and if your setup is so that slots or inventories may or may not exist, then the first solution is probably right

      Comment


        #4
        Just to add to the above... Timing issues or glitches in Editor vs Packaged games, make this error tricky to avoid (completely at least). Using IsValid is helpful, but often it needs to be run in a loop while waiting for some critical sub-functions to execute or complete first etc...

        Comment


          #5
          Thanks problem soved

          Comment

          Working...
          X