Hello, I am currently working on a UMG material that is supposed to immitate the moving shine light on a metalic surface (this kind of sheen effect) to highlight the text on my widget.
I’ve managed to create the effect, and I am quite happy with the results. There’s one thing I need to adjust and completly don’t know how - it’s ‘frequency’ so to speak. The ‘shining’ effect endlessly cycles from left to right and I would like for it to take a break after it reached the end of texture (by that i mean the max of X), wait a couple of seconds and eventually start again.
I’ve tried manipulating the parameters via code during the gameplay, that was partly successful, but the effect reappeared in random moments of it’s cycle (eg. starting from the middle). It’s offset is just random. I’ve also tried creating new material instances every few seconds and setting it to a text, but it doesn’t seem to work either.
That’s my current material. I do hope it’s understandable and that there’s a simple solution to this ‘issue’ cause i am starting to lose my mind. Thanks in advance!
Here’s an example of effect I am trying to replicate.
Basically you can see there is a “Time” input in the panner, you can plug there a time node multiplied with your custom variable, you can also use “add” to use it as “phase”, or purely use a custom variable to process your time of panner, you can control it via blueprints with infinity timer value that can pause each second for example, this is not the most effective way but it should work, hope it helps.
I’ve already played with the Time plug but didn’t make any reasonable results. If I multiply the Time (input data) I can manage the speed of the sheen effect - that’s true. But how do I detect what’s the current position of effect? How do I pause it on a certain spot? If I go with the Time of 0 all I get is a vertical line in the middle.
Time is basically a infinity time variable, like “get game time in seconds” however it can be also cycled after some value where it gets looped, example if it goes to loop after value of 2 at the same position where it was at 0 then you can reset it to 0 after that value. In any case you can pause the value at certain points, you can manually drag the custom “Param” in instance view to see the range of points that you need, and then inside blueprints just make a system that pauses the value at certains points and then continue, also you can reset it at some points to make cyclic time value, hope it helps.
In short, if 0 is the middle point, then you can start from -1, or any other value that fits your starting point, and just progress the value until it gets to the visual ending point, and then reset the value, use the delay and then continue the progress again.
I understand the logic but how do I get the information out of Material to blueprints?
When I try plugging a param to the Time plug-in Panner node nothing happens. Even if I try to manually change the param’s value through blueprints.
You don’t need to get information out of the material, but instead you can control the custom parameters of material from the blueprints. Create the dynamic material instance, promote material reference as variable, get the reference and use with “set scalar parameter value” to update the value. If you are not sure, recommend to look for the tutorials about dynamic materials, hope it helps.