There’s a bunch of ways you can do this, but here’s a quick and dirty explanation of how I’m doing this right now (Don’t try to follow these images to the letter, they’re not intended to be a true tutorial):
You start with an input event - You can do this by listening for them in your player controller, pawn, or even hack it using the event tick method in the widget itself. In the screenshot below, I’ve bound a custom event inside the widget BP to an event dispatcher inside my player pawn BP, where the actual input events happen. You can then use various logic checks to ensure that the event only fires in the proper context (for example, only when you have the menu open).
Finally, you’ll need an index integer. This integer will be used to tell you which child of your scroll menu is currently active. The basic idea here is that every time you press a button (in this case, up or down on the D-Pad), you will increment or decrement the index variable, and change the context of your scroll menu accordingly.
So you hit up or down on the D-Pad, and when you do, you need to increment or decrement your index variable. Each time the player presses the button, you should also give them some feedback, like a little audio click or whatever. When you’re done with that, you’ll need to change the context of the scroll widget.
In my case, I simply change the scale of the button (this is so the currently active button is slightly larger than the others in your scroll list, easier for the player to see) and then scroll that child into view. (This is so that, in case you have more child widgets than you have visible space in your scroll list, you’ll still be able to view them all). Make sure you check the “Animate Scroll” boolean to ensure it looks all fancy. Finally, you can do whatever else you need to do now that the proper button is active (In my case, you can see I’m setting up descriptions of the item you’ve selected).
Now that you’re able to scroll through your widget, you can simply use the context of another button to take action on the children of your scroll list. For example, if you know that the “Quit Game” function in your scroll list is at index 4, you can code the ‘A’ button in such a way that it will only quit the game when you hit the ‘A’ button while the index is at 4.
This gets somewhat more complicated if you have a dynamic scroll list that could populate different quantitites of children at different times, or a scroll list where the children are not always in the same order. I’m not going to go into much detail about that here, but suffice to say that if you have a dynamic list that can change the number of children, you’ll need to add those children to an array and use it’s length to determine how far you can increment you index, as shown below:
As for a scroll list where your widgets aren’t always in the same order… you’ll basically need to ensure that your child widgets have some sort of unique identifier. I use enums for this. You can see an example of such earlier in this post, at screenshot #3. (Get the child of FoundGearListRows that is at the current index, and then check it’s “Name” enum before setting it’s Gear Description).
Hope that’s helpful!