I’m making a widget for one of my gameplay abilities with a progress bar, but I have multiple characters who have different icons for this ability. I’d like to use the same widget for all characters instead of making a widget for each one, but I can’t seem to figure out how to set the background image of a progress bar in blueprints. Is this possible?
UMG’s ProgressBar doesn’t expose a Blueprint setter for its Style (the background brush lives in the Style > Background Image struct and is only editable at design time), so you can’t swap it per character on the bar itself.
The usual workaround for a shared widget:
In the widget, put an Overlay (or Canvas) with an Image widget as the bottom layer and the ProgressBar on top. In the ProgressBar’s Style, set Background Image to “no brush”/transparent tint so the Image shows through (keep the Fill Image as is).
Expose a Texture2D / SlateBrush variable on the widget (Instance Editable + Expose on Spawn), and in Construct (or a SetIcon function) call Set Brush from Texture on that Image.
When you create the widget for each character, pass that character’s ability icon in.
If you just need different fill colours per character, Set Fill Color and Opacity on the ProgressBar is available in Blueprint. If you really need the bar’s own style swapped, you’d need a small C++ wrapper or a subclass that calls SetWidgetStyle, or just make 2-3 style variants of the bar and toggle visibility.
Select the Set members in Progress Bar Style node, in the Details Panel, enable the options you want to change. For example, Background Image and Fill Image.
The above steps will overwrite the whole Background Image settings. If you only want to change the Image, and keep rest of the settings, follow these additional steps:
Drag from the style node and search for the Break Progress Bar Style node.
I’d try setting up the progress bar’s background through the UMG widget style so you can reuse the same widget for different characters. Keeping the visuals configurable should make things much easier to manage, just like choosing the right Dura truss setup for different project requirements.