# Dynamic material based on player health

**URL:** <https://forums.unrealengine.com/t/dynamic-material-based-on-player-health/481887>\
**Category:** Rendering\
**Tags:** health, unreal-engine, question\
**Created:** [April 14, 2021, 4:01am UTC](https://forums.unrealengine.com/t/dynamic-material-based-on-player-health/481887 "2021-04-14T04:01:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![live4film](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@live4film](https://forums.unrealengine.com/u/live4film)\
**Post date:** [April 14, 2021, 4:01am UTC](https://forums.unrealengine.com/t/dynamic-material-based-on-player-health/481887/1 "2021-04-14T04:01:12Z")

</div>

I have a player health system that I would like to connect to a dynamic material instance. At 100% health, the material is normal color. And when the health gets lower, my parameter for my color change turns a darker color. My parameter on my material instance is a vector parameter. So I thought about using a set vector parameter node, but that didn’t work. It doesn’t go down incrementally in relation to the health.

Currently the material instance changes the color on the first hit, but it needs to slowly get darker in relation to player health.

 ![335823-lungs-health.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/b/c/5bc31454ca264356e24898780eda99983da7b9a2.jpeg)

---

<div class="post-metadata">

**Author:** ![ugmoe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ugmoe](https://forums.unrealengine.com/u/ugmoe)\
**Post date:** [April 14, 2021, 6:06am UTC](https://forums.unrealengine.com/t/dynamic-material-based-on-player-health/481887/2 "2021-04-14T06:06:51Z")

</div>

need to see the part where you change the color

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [April 14, 2021, 10:03am UTC](https://forums.unrealengine.com/t/dynamic-material-based-on-player-health/481887/3 "2021-04-14T10:03:43Z")

</div>

You need to create it once on begin play, then change it here… using set vector parameter value.

 ![335858-screenshot-1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/c/f/0cfdf676d3327e91eb3e35d83d5dcf085ad01164.jpeg)

![335859-color.gif](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/7/3/6733c1100e22c00d7c329140259885f6ddceabe0.gif)

---

<div class="post-metadata">

**Author:** ![live4film](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@live4film](https://forums.unrealengine.com/u/live4film)\
**Post date:** [May 5, 2021, 4:45pm UTC](https://forums.unrealengine.com/t/dynamic-material-based-on-player-health/481887/4 "2021-05-05T16:45:04Z")

</div>

I just got this working. Your setup works really well. Thank you!
