Dear UE Community,
I am currently working on an ingame HUD (UE 4.24) for a game and am going crazy about a seemingly very simple thing and wanted to ask if someone knows if I’m doing it wrong or has ideas how to apporach this in a better manner.
I have an ingame HUD that looks like the following:
What I try to achieve is that when the “Build” button is clicked, the grid should be populated with buildable items. The items are of a separate widget class “BuildMenuItems”.
Creating the items runs in the button released event of the “Build” button:
Here want to set some variables (I tried different types for testing purposes, Text, String, Int) that are then available in the item construction (to display as item name). The items are created and the layout is visible in the game but the values of the spawn pin variables are all empty.
In the following BP which is the BuildMenuItems BP I want to work with the variables that I passed via the spawn pins of the widget but all of them are empty. Does anybody know why or what I am doing wrong? It might be a noobish question but for me it would make perfect sense if this is working like I tried but maybe I am just not understanding how references / object instances work in BP.
In the above example I am just printing the values of the variables. All are empty. I tried it with every available event. It triggers but the values are just as if they were never set in the spawn pins. I also tried to feed the values in different ways to the pins, removed, readded, refreshed the creation nodes etc. I don’t understand why this is not working…
So far, thanks in advance for your time!