# How Do I Change Highlight Colors Using Material Instances

**URL:** <https://forums.unrealengine.com/t/how-do-i-change-highlight-colors-using-material-instances/418022>\
**Category:** Rendering\
**Tags:** Post-Processing, unreal-engine, question, Blueprint\
**Created:** [February 22, 2018, 3:55am UTC](https://forums.unrealengine.com/t/how-do-i-change-highlight-colors-using-material-instances/418022 "2018-02-22T03:55:20Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_2f2290ec](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2f2290ec](https://forums.unrealengine.com/u/anonymous_user_2f2290ec)\
**Post date:** [February 22, 2018, 3:55am UTC](https://forums.unrealengine.com/t/how-do-i-change-highlight-colors-using-material-instances/418022/1 "2018-02-22T03:55:20Z")

</div>

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.

 ![231587-screenshot-3.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/e/3/2e3ca12fcb8214b3a0a9bbbd045b790ffe634d45.png)

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.

---

<div class="post-metadata">

**Author:** ![c4tnt](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@c4tnt](https://forums.unrealengine.com/u/c4tnt)\
**Post date:** [February 22, 2018, 5:46am UTC](https://forums.unrealengine.com/t/how-do-i-change-highlight-colors-using-material-instances/418022/2 "2018-02-22T05:46:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2f2290ec](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2f2290ec](https://forums.unrealengine.com/u/anonymous_user_2f2290ec)\
**Post date:** [February 22, 2018, 6:08am UTC](https://forums.unrealengine.com/t/how-do-i-change-highlight-colors-using-material-instances/418022/3 "2018-02-22T06:08:54Z")

</div>

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.

 ![231602-screenshot-4.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/b/f/9bf425871801a722d2cfb79ef01c42133303dd05.png)

Construction Script

 ![231604-screenshot-5.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/4/1/f419416ba1fdbb36a37fcc48d3ea12ac51af7ec0.png)

Function

---

<div class="post-metadata">

**Author:** ![c4tnt](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@c4tnt](https://forums.unrealengine.com/u/c4tnt)\
**Post date:** [February 22, 2018, 6:21am UTC](https://forums.unrealengine.com/t/how-do-i-change-highlight-colors-using-material-instances/418022/4 "2018-02-22T06:21:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2f2290ec](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2f2290ec](https://forums.unrealengine.com/u/anonymous_user_2f2290ec)\
**Post date:** [February 22, 2018, 6:28am UTC](https://forums.unrealengine.com/t/how-do-i-change-highlight-colors-using-material-instances/418022/5 "2018-02-22T06:28:41Z")

</div>

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.  
[1]:

 ![231605-screenshot-6.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/b/3/5b3b93f0da2ac5cbe8ce6475fe0b85dadada7a63.jpeg)

---

<div class="post-metadata">

**Author:** ![c4tnt](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@c4tnt](https://forums.unrealengine.com/u/c4tnt)\
**Post date:** [February 22, 2018, 6:34am UTC](https://forums.unrealengine.com/t/how-do-i-change-highlight-colors-using-material-instances/418022/6 "2018-02-22T06:34:35Z")

</div>

Can you check your color changer with following material please?

 ![231595-colopp.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/1/2/912f3c39d6095eebc8986723b3fcb2e63db82c7c.png)

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

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2f2290ec](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2f2290ec](https://forums.unrealengine.com/u/anonymous_user_2f2290ec)\
**Post date:** [February 22, 2018, 6:39am UTC](https://forums.unrealengine.com/t/how-do-i-change-highlight-colors-using-material-instances/418022/7 "2018-02-22T06:39:02Z")

</div>

I got this from the sample content.

 ![231606-screenshot-7.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/d/5/6d522839aa142b51830561e351e43d6eec4eb688.png)

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

---

<div class="post-metadata">

**Author:** ![c4tnt](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@c4tnt](https://forums.unrealengine.com/u/c4tnt)\
**Post date:** [February 22, 2018, 6:46am UTC](https://forums.unrealengine.com/t/how-do-i-change-highlight-colors-using-material-instances/418022/8 "2018-02-22T06:46:03Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2f2290ec](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2f2290ec](https://forums.unrealengine.com/u/anonymous_user_2f2290ec)\
**Post date:** [February 22, 2018, 6:51am UTC](https://forums.unrealengine.com/t/how-do-i-change-highlight-colors-using-material-instances/418022/9 "2018-02-22T06:51:58Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![c4tnt](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@c4tnt](https://forums.unrealengine.com/u/c4tnt)\
**Post date:** [February 22, 2018, 6:55am UTC](https://forums.unrealengine.com/t/how-do-i-change-highlight-colors-using-material-instances/418022/10 "2018-02-22T06:55:36Z")

</div>

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](https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/ParameterCollections/index.html)
