Accessing Widget Component Values from Blueprints (4-27)

Hey.

I want to have a Widget in 3D Space which I need to change dynamically based on some input.
So I have a Blueprint and I want to access things like the size of an image inside the Widget Component. But I can’t bind it or anything.
Is there any way at all to access these things properly?

Best regards!

Get the user widget the component is holding onto and cast:

1 Like

Thanks for the reply!
I guess I wasn’t specific enough.

This will get me access to the Widget as such, but how to I control values on Components inside the widget, say for example I want to set the SizeX on an Image Component/Slot inside my Widget.

You may need to be even more specific because it’s still this:


Besides that, consider creating a custom event / function inside the widget, and call that instead. You could even equip widgets with an interface to avoid casting altogether. And to take it one step further, one can override the entire component:

Pretty handy should you wish to declutter the component owning actor.

1 Like

Man, thats it!

Thank you so much. I had something similar going, but obviously missed something. Slot as Canvas slot is what I was missing!
Thanks!

1 Like

Just to clarify, this will depend on the slot type the widget is placed in. For an image inside a border, you’d get Slot as Border Slot.

1 Like

Okay, good to know.
Scripting UMG still feels kinda weird.