Change tint of image in widget component, using BP

I have a Blueprint Class (DetectionActor). It has a Widget component attached to the root; the Widget component has the Widget Class set to DetectionMat, which is a Widget Blueprint I have created.

DetectionMat has a single image widget attached to the root (named Patch9). I want to change the color of Patch9.

Manually changing any of the following properties in the editor does what I want:

  • DetectionMat/ColorAndOpacity
  • DetectionMat/ForegroundColor
  • DetectionMat/Patch9/Tint
  • DetectionMat/Patch9/ColorAndOpacity

How can I change these properties at runtime, from DetectionActor’s BP?

Here’s what I’ve tried in my blueprint (all failed):

  1. Call Set Tint Color and Opacity, passing in Widget component reference. Does nothing.
  2. Cast the Widget component to a DetectionMat (the editor says this will always fail).
  3. Get Children of Widget, in an attempt to get a reference to Patch9 (this gives me Scene Components, which can’t be cast to UserWidget)

You can access the embedded widget like so:

Thank you, Everynone.

On UE 4.22 there’s a warning saying Brush is a read only property

1 Like