Need assistance using buttons created from a dynamic list using a struct

Hi UE peeps,

I’m still quite new to UE blueprinting and I’m a bit stuck, for my project, I created a dynamic list of Avatars that will have a button allowing the user to choose the avatar. Right now when I click an avatar with a test Print String, it prints all the rows from the Struct, this isn’t the behavior I would like, I would like the button to only print the row the avatar belongs to if you know what I mean. I’ve tried a few things, but here’s where I’m at.

I have a blueprint which has the Dynamic Scrollbox which will house the list of Avatars



I then have another blueprint which houses the button/Avatar info that will populate the previous scrollbox

THe graph here works fine as you can see I call the Update Avatar custom event and replace the button images etc, works great, but as you can see the OnClicked (Button_305) Event isn’t correct, what am I missing here? ANy help would be awesome. Thx!

And here’s the result so far if interested
image

~t

  • in the avatar widget, create a variable of the type the Data Table uses and expose it:

Widgets can use it during construction and for interaction later on.

  • when you populate by creating avatar widgets, pipe in the struct data from the DT:

We do not loop or access the DT inside the avatar widget; each avatar has its own respective struct and that one struct only.


And if it ever needs updating:

Or overwrite the entire struct, if needed.

Hi, @Everynone I think he also needs to know how to bind the button to the WB_AvatarMenu

2 Likes

Don’t see anything above that needs it, but knowing life it may be needed later on, sure:

Either bind it where widgets are created, or send the data to whatever blueprint needs it; here I’ve assumed it’s the Player Controller but the Game Mode may be more reasonable as it often deals with pawns:


This may be irrelevant. @DomusLudus roped me into this :innocent:

2 Likes

Big thx @Everynone & @DomusLudus Will for sure try this later today and let you know how it goes.

How’d you know I was also a bit puzzled on how to bind the button as well? :slight_smile: Cheers guys.

~t

1 Like

pff, @DomusLudus - fair enough

1 Like

Hiya I should’ve mentioned earlier, my game is completely Widget based, so I’m not user Actors.

So for the variable type, you’re referring to the Struct here yah?

Also my “OutRow” is a bit different here as I split the pin

So I did this temporarily

@Everynone & @DomusLudus Scratch the above, it worked! I didn’t realize I had the Construct UI Widgets already in the chain and it was cancelling out the prior one! :tada: Big thx, I would’ve been stuck for awhile as I wasn’t aware of Expose on Spawn

Cheers!

~t

2 Likes