Why does this canvaspanel setPadding method fail to change size during umg runtime?

Is this canvas inside a Size Box?

Are there any umg controls that can be resized at runtime?

Your script was not working because you asked the size box to adjust its padding and you do not even have a size box.

There are too many ways to adjust widget size and all of them work run-time. It really depends on what you want to achieve.

For starters you can literally tell the widget to:

But again, there are specific tools for specific jobs.