Hi everyone
I’m working on a VR project in which I have an Actor that functions as a main menu. From this menu, I can access different submenus — one of them is an inventory system. All of these are implemented as Widgets.
Im ussing the actor menu from vrtemplate map
The inventory system is handled through an Actor Component, and the logic for storing items in the inventory is working correctly — items are added properly to an array.
The issue I’m facing is when I try to display the items in my inventory widget — nothing shows up.
My inventory system is made of two widgets:
The parent widget: HUD_INVENTARIO_EQUIPMENT_FEATURE
The child widget: WM_SUB_MENU_SLOT_EQUIPMENT
The child widget represents each slot (item), and the parent widget is responsible for storing and displaying them. I have a function that is supposed to load all the slots every time it’s called, but I can’t get the inventory to visually appear in the menu Actor.
I’ve verified that the logic runs, and the array seems fine, but the UI just doesn’t show the items
Does anyone know how to get those items to display?.
My suggestion would be to add one child widget into the wrap box in designer window and see if it will show up properly. It’s to make sure that slots can actually display inside this wrap box.
If it doesn’t show up, then it might be the case of not having enough room.
Another thing could be a race condition, try adding a short delay before you try to add slots. I believe just after you resize the array would be a good spot to do it.
I can see that 15 entries are created, but they have no data? If you’re not creating more then one list of widgets then your problem is data not coming though, most likely because a reference isn’t valid.
My suggestion would be passing over a reference to your inventory component when you create the widget itself. (Create HUD INVENTATIO …). So basically don’t pass over self into your CARGAR INVENTARIO function. Instead you would already have a reference in your widget and you would use that instead. Should be a quick thing to test out.
I’m not entirely convinced that where you pass Self to function that it’s actually valid.
Where I created the widget is in the inventory component actor.
Now it no longer displays anything. What I did was remove the load inventory function from the component actor and get the reference to play the entry animation of the widget in question.
Not quite. Let me help you with some visual aids. I made a mock up blueprints and widgets and I kept some of your naming so it’s easier for you to follow. Hope that clears things up.
where do you create the WBP_example widget, is it in the component actor or in another widget?
I say this because of the reference you use when creating it.
Thanks for helping me, I found a solution, I literally redid the inventory XD, thanks for the tips @DonBusso you helped me a lot. I just need to correct some visual issues like the scale but nothing more serious.