Text Needs to Be Set, Correct Input, But Does Not Work

I’ll try to explain this the best I can. I have set up a system for a description of an item in the inventory when it is hovered over.
As you can see in the video, when the value that is being set to the description text is printed as a string, it is the correct value, the seashell’s name and description being printed when hovering over the seashell, and the key’s name and description being printed when hovering over the key. However, as you can also see, the text ISN’T being set to that value, because when hovering over the seashell, it has the text for the key.
I’m sorry if my wording is confusing, I’ve tried to articulate well but it’s an early morning and this is hard to explain :,)
So in short, my question is, how do I get the text to read the appropriate contents, matching to the item I’m hovering over? Thank you!

Hey @Maximum.Dino ,

If you instead call the SetText function node on the TXT_ItemName and TXT_ItemDescription does that work succesfully?

Also where is the ItemID set? Is it grabbing the right row from the Data Table?

I tried the SetText function node and it didn’t seem to change anything.

Okay, so I’ve noticed I don’t seem to have anything that sets the ItemID. I’m not sure where to get it from because I need it to find the data table row, so I can’t get it from the data table, if that makes sense. I followed the tutorial so I’m not sure where he got the ItemID from? Hm.

Here’s the entire thing now. Inventory Slot posted by anonymous | blueprintUE | PasteBin For Unreal Engine

Yeah so I think that ItemID is what needs to be set based on what is added to that Slot. It might be worth just scrubbing back through the Tutorial in case something was missed or maybe its explained a bit later in the tutorial?

1 Like

This is the place in the tutorial that he creates the variable, and later on, he sets this blueprint up, which is actually setting the itemID to the correct value (I tried printing it out here on spawn and it’s reading correctly).
So when the Inventory Slot is created (event preconstruct), the ItemID has been set correctly. Knowing this, when I take the ItemID and use it as the row name (because they’re matching) it should pull from the correct data table row, but it doesn’t, it only pulls from the key. and that’s where I’m stuck now.

Okay so revisiting the earlier messages with that context it does seem to be pulling the right information and we can see from the Print that its correct. How is the hover Widget setup? The one that is actually displaying the text, is that part of this or is it pulling the information from the data you set there?

1 Like

Oh… haha so I had a different blueprint that was ALSO setting the text, but incorrectly- so I just worked it out and it works just fine now. Thanks for your help and sorry for the time spent on it :,)

No worries, happy to help

1 Like