How Do I Change Highlight Colors Using Material Instances

I am using a postprocess volume on an actor to make it glow in an outline. In construction script, I set a default color and it works fine. Beyond that, I use a function to try and change the color while the game is running. This is where the problem lies. The color will stay the same as the default no matter how many times the function is run.

I have no clue why this doesn’t work, as it is the exact same function that works in the construction script. Any help is deeply appreciated.

Thanks for the response. I tried your suggestion. Tell me if I am doing it wrong, because it’s doing the exact same thing as it was before.

Construction Script


Hi. You have to set your dynamic material instance only once using AddOrUpdateBlendable node. Also you need to store that instance to a variable and then change colors on this instance without touching blendables.

At your current setup you create a new unique instance each time and add it again and again to the postprocess. These instances are different because CreateDynamicInstance creates a new one instance each time, so AddOrUpdateBlendable adds each of that instances to the end of a postprocesing stack. But your first blendable weigth is 1.0 and it overlaps any next blendable completely.

I checked very similar configuration on my current installed UE version (4.16) and it worked fine. Unfortunately I can’t install exact 4.18 to test with it. Can you check your postprocess component and world settings for any existing postprocess materials? And check a parameter name - maybe it’s different than used inside material. Maybe you got any log warnings.

Alright. Unfortunately it doesn’t work. I checked the component and I had removed the postprocess volume from the world beforehand. Parameter name checks out. Any other methods to achieve a similar result?

[alt text][1]

Something like this. A glowing outline of the object that will still keep the texture when I apply one.

I got this from the sample content.

It works. The color just won’t change when I create a dynamic instance of it.

Tried that. Same result. I’ve been at it for a while, and am pretty convinced that it just wont work in 4.18 for whatever reason. Do you know of any other way to make a static mesh glow a little or have an outline?

Can you check your color changer with following material please?

It will tint whole screen each time you change a color (It just to discover what exactly doesn’t working)

Material looks fine, I have no idea why it doesn’t catch up a color. If you copied it from somewhere can you try just recreate a Color param node?

At least you can use mesh material\vertex color itself if you just want to highliht a cell (draw a shape mask texture and recolor a mesh material). Also you can try to pass a color using global shader parameters: Material Parameter Collections | Unreal Engine Documentation