UMG - Setting dynamic material values on widget

Hi,

I’m developing a first-person VR game and I want a blinking effect on my camera. To do that I have an instanced material called M_Blink_Inst which have some values that create the effect of a blink (simple). The material has “User Interface” domain. I created a widget called UMG_Blink that has just one image component which texture is my M_Blink_Inst.

To make it work, in another BP called BP_PlayerCar (is the player I’m using inside a car where the blinking effect should work) I add a widget component (which class is UMG_Blink) and a stereo layer component that is Face Locked and has the “Live Texture” checked. In an event called “Possessed” I get the widget class with the “Get User Widget Object” node, cast it to my UMG_Blink, get the Image from the widget and from there I get the “Dynamic Material” (which I think is my instanced material). Then with a Timeline and the “Set Scalar Parameter Value” I want to modify it on runtime but that is not happening.

In the game I can see the blinking material but it won’t move anyway.

Hope you can help me out, PLEASE! I’ve been struggling a few days with this problem. Attached you will find some pics that may help you. If you need anything else, just let me know.

By the way! My first attempt was using post process materials… but I couldn’t get the material through the Post Process Settings node to modify it…

Thanks in advance!

Regards,
Jovimaca.

what you need to do is create a dynamic material instance and set a new brush on your image. Then you can change whatever parameter you want in your material.

1 Like

Oh! Flash7 thank you so much for your help! I’ll give it a try and I’ll let you know!

Regards,
Jovimaca.

Hey Flash7, sorry for the dumb question >.< How do you get the node that outputs from the “Image Charge” variable? I cannot get it… haha! I feel really dumb, but I’ve never used this kind of nodes.

Not sure what you mean, but this is how I use it:

Yeah! I solved it!

I’m now able to change values from my material on my umg with a Timeline. The problem now is that the material is not changing continuously but “by chunks” (I don’t know if I’m explaining properly). I guess the problem is on my material…

Anyway, I’ll give this question as solved since you really solved it! Haha! Thanks a lot!!

Regards,
Jovimaca.

It was a problem related with the duration of the timeline and the rate of it. Everything’s fine now!

thankkkssss. I was stuck from last 2-3 hours. Cux of your reply I fixed that. Thanks