Cannot access the widget inside the Widget Switcher

Hi, everyone! My first question here. It might sound like I’m having a problem with th widget switcher, but I guess it is more about bluepring communication.

So here’s my setup:

I Have an inventory-like menu. For my game’s purposes I call it a Wooflog. There are 3 separate submenus Clues, Trails and Memories. The culprit so far is the Memories thing. It is basically an inventory, to wich the player collects items (memories). All of these menus are inside a main WoofLog widget and are switched through Widget Switcher.

  1. Item, a Memory returns a string on pickup. This works.
  2. Inventory Blueprint receives a string and stores it into the array. It has a function AddMemory. This works, until it comes to a custom event AddMemoryTo to WoofLog, which should add a child (a separate widget) to a Memories widget. It doesn’t add anything.
  3. Player character picks up the Memory throught Blueprint interface, this seems to work too.
  4. What does not work, as far as I understand, is that player character creates a Parent Widget (Wooflog), and in time of picking up the Memory, none of the widget children (Memories widget in particluar) exist. So the execution on the custom event (creating an item in a memory widget) doesn’t work. As I understand, that reference to a widget returns nothing (contains nothing) because it does not exist yet.

I know that asking what I’m doing wrong is way too vague. So I’ll put it this way. How to add an item to a menu that is inside a widget switcher. Referencing it didn’t work as it doesn’t exist and returns no data, or I am doing this wrong.

Here are a couple of screenshots of the blueprint setup:


The widget look.


Tabs/Widget switcher setup


Inventory Blueprint setup


Pickup function


Adding a child to MemoriesWidget event


Third Person Controller Pickup Setup


Inventory Widget initialization Setup

I will appreciate a feedback and any practical advice, thanks in advance

Are you calling set focus when you switch the widget?

1 Like

Nope. You think this might be the problem?

Honestly, I don’t think this might be a problem, the problem being the widget returning none after picking the item up. In short, item gets picked up, returns the string, string adds to the array, but no item is added to a nested inventory widget inside the widget switcher because it doesn’t exist at the time of pick-up. I vaguely understand the problem, but my knowledge is obviously not enough to make it somehow work.

In the Add Memory you are getting the WP Wooflog Memories from the character - can you show how you create this variable? Are you sure it is properly initialized and remains valid?
Maybe I am wrong, but looks like you create WP_Wooflog by pressing some key - but then Wooflog Memories won’t exist before it?

1 Like

Hi! Indeed, I was setting this value on the Input button, after creating the Parent Widget. I also thought this is a problem and to an extent it was. But. I tried to set it on the EventBeginPlay and stuff in child WPs didn’t work. As I understand Creating the parent widget does not create child widgets. So when I create Wooflog widget, the Memories widget still does not exist.

I was under impression that if I make a simple Inventory and then just shove it into the widget switcher, it would work, but so far it does not and by now I’m a bit lost and don’t think it was a good idea.