How to edit material parameters from widget?

I’ve been trying to get my healthbar widget working and have been running into a couple of issues.

Ideal Functioning
The healthbar widget should dynamically adjust based on the total health of the player (which determines the number of segments), the current health (which determines the number of filled segments), and the special health type/amount (which determines the color and number of the colored segments).

Issues

  • The material should be segmented, but the segmentations are distorted.
  • The parameters are not effectively being set via the widget.

Current Setup

Material: This is how I’ve set up the material. No textures are involved, and all the parameters work as intended when adjusting them in the material BP. The material domain is set to user interface.

Healthbar Widget:

  • Event Construct: Here I create a dynamic material instance using the material I created, set it to a variable in the widget BP (Healthbar MID), and then set the brush resource to that material. (This was done by creating a binding in the brush of the image component).

  • Initialize Function: This custom function is called from the Combat_HUD widget, which uses this healthbar widget on a canvas panel. The earlier portions of the function (not pictured) get attribute values based on player attributes in GAS and set the variables used to adjust the parameters. Those values, and the value of Healthbar MID, are all valid. Using the Healthbar MID variable, I call Set Scalar/Vector Parameter Value with the parameter names directly copy and pasted. Currently, there’s also a row of print strings to make sure the variables are correctly set.
    When I skip the step to set the parameter of ‘Total Segments’, the distortion disappears, but issue two still persists

Attempted Solutions

  • Moving the event construct logic to pre-construct or to the first part of the sequence in the initialize function.
  • Wrapping the widget with a retainer box and only assigning the material as the effect material of the retainer box.
  • Other options/nodes for getting the material reference, i.e. Get Dynamic Material (Target: IMG: Healthbar), Set Brush for IMG_Healthbar
  • Creating a new, simpler material with only a single parameter to change - no luck there either.

Any thoughts on next steps to get this working?

Realized that I didn’t include an image of the distorted healthbar; adding it here since an error prevents me from editing it into the original post:
Screenshot 2025-08-05 104002