Download

Widget Buttons transform to text only after shuffle

Hi everyone, I’m having so issue with a widget blueprint.
I’m doing a Multiple Choice Questions in VR. Questions and answers are picked from a data table where the right answer (Réponse Juste in french) is always in the third column. (Data Table is a csv from an Exel File made by people who never and will never use Unreal).


I made a widget blueprint with the question and the answers. Answers are another widget wich contains a button and a text, whear I set up the vr interactivity with the player. I did it this way so I can re-use this widget in other widgets which need interactivity.

Everything work fine exept the right answer is always the first one. So I made a little script to randomize the answers. That worked pretty well with button within the widget, but when I use my external button widget, all text are on top of each other and there’s no background button, padding or margin.
Here’s the script:

Result without shuffle:

Result with shuffle:

I don’t undersant why the button is just a text and not a button anymore…

Therefore I need some help :slight_smile:

The fill and alignment settings are stored in the child slot, not on the child widget itself. When you removed the widgets from their parent panel, the slot settings are gone. You need to take the output from AddChild, cast to VerticalBoxSlot, then call the functions to set the alignment to the values you want.

Thank you very much, you save my day!!!
Here’s the final script:
[ATTACH=JSON]{“data-align”:“none”,“data-size”:“full”,“data-tempid”:“temp_165724_1559314295774_788”,“title”:“forum7.png”}[/ATTACH]
https://forums.unrealengine.com/core/image/gif;base64