Struct variable not passing into blueprint sometimes

I’m trying to make an inventory system which uses a struct for all details needed from the items, and then 1 blueprint to apply the mesh to and all the details like stack size etc.

I’ve used print strings to ensure this is indeed working. Then the thirdpersoncharacter casts to it and tries to add it to the inventory component here, which through print strings I know it works

However when I try to add it to the inventory components “try add item” function, the item data does not make it through. I originally was just using the struct variable and breaking it down after passing it into tryAddItem, but that returned empty. Passing the data table works, but passing the name only works on 1 of 2 items.


I want to just pass the struct variable but not even passing the seperate variables works so I’m lost. TIA

well the data table in try add item will only ever return the default values, assuming its set in the item

thing to check

  1. is the cast failing?
  2. is the item struct set properly on the item_default
  3. with structs sometimes you need to check if you’ve modified the original (ref) or duplicate (copy)

i would just start by validating the data at every point and see where its lost

Using print strings I determined it only gets lost when it passes into the tryAddItem function. My thirdPersonCharacter has all the correct values as well as the item_default

im a bit confused though, you’re passing the item through but then using the data table instead? the DT will always be the default values

Ok I figured it out. I renamed a row but my items I’d placed didn’t adjust their row name like I thought they would. That’s why one of my row cannot be found.

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