I’m trying to dynamically set the Padding (or Position) of a Widget Element but it seams that the cast from a panel slot reference to its actual type, always fails. Wheter I try to cast the Panel Slot Reference from a Horizontal Box to a HorizontalBoxSlot or the Canvas Panel Slot Reference itself to a Canvas Panel Slot, it always fails and triggers the “Cast Failed”.
I tried with different Widget Object Types like Boarder, Sized Box but they all fail to cast its slot to the proper class.
I also tried to make Variables of the Widget Object Types in case they’re not directly accessable but that also won’t work.
Is this a bug in the engine or am I doing something completely wrong?
The Event that triggers the cast is in the same BP (Widget) as the Horizontal Box I’m trying to manipulate.
I’ve got the idea from this post ==>>
[How can I dynamic to change the UMG’s widget position or padding][1]
Here’s a Screenshot of my BP: