Question: How do I get the ID of a dynamically created button to look-up in an array?
Details: I have an array called “MyCharacterSkills”, which is generated from a base array of skills available for that character archetype. I then determine how many skills in the array are of the ID assigned to “Skill of your Choice”.
In UMG, I have a main UI widget named CharacterSheet which contains an Overlay > Scroll box > Vertical Box. I have a second widget called SelectableSkills that just contains a Button and child Text which changes based on the name associated with the Skill ID passed into the widget’s text variable.
A ForEachLoop creates one button (and text) per skill, giving me a list of skills to choose from, with IDs of (for instance) 200 to 235 within the vertical box. Inside the ForeEachLoop, I assign the Skill ID from the array element to the button via the “Skill Button ID” varialbe, and using an “OnClicked” event within the button widget, I can PrintString and verify the ID is properly set to the button.
I don’t know how to get the ID of the button the user clicks back to the CharacterSheet blueprint, which I will then use to reassign that skill ID back to the user’s “My Skills” array.