Simple UMG Material Compass

Hi all. I’m trying to get a simple compass working.

I was reading the info at the bottom of this page
This shows the end result I want. But its done in code and i’m not sure where to implement it via blueprints.

Here is how I’m calculating the angle in my character class.
Compass Function…
Character Event Graph…

This is the material I’m using.

This is the setup in the event graph of the Widget Blueprint.

Do I need to bind the image in the widget? I just can’t see how this is done…

Any ideas? This is driving me nuts. It seems like something that should be so simple but I just can’t figure it out.

Thanks in advance everyone!
Any help is very much appreciated.

Assign the material to the image widget in the designer, then there’s a function you can use on the image widget. I think it’s just called GetDynamicMaterial - and that will handle creating and swapping it on the brush.

Right. I really have no idea how to do this… I’ve looked and looked for some info on it but I cant find anything. And nothing I’ve tried seems to work.

This is the event graph in the compass widget currently. But the compass doesn’t move.

Here is the designer view.

You’re not actually saving the created MID. You should delete the “Create Dynamic Material Instance” node and the set node you have - and instead add a set node for the results of the “Get Dynamic Material” call - That is the MID you need to update every frame. Is your pan really a vector parameter? I would have thought scalar.

Something like this?

I dont get how your supposed to create the dynamic material. And do you reference a material, or a material instance??

I’m literally banging my head against a wall trying to do this. None of it seems logical.

Thanks for the help.

“Get Dynamic Material” creates the MID. It swaps out the MI on the brush you set in the designer. You don’t need that other brush member.