# How to properly set Vector Parameter Value?

**URL:** <https://forums.unrealengine.com/t/how-to-properly-set-vector-parameter-value/306214>\
**Category:** Rendering\
**Tags:** unreal-engine, UE4, Blueprint, question\
**Created:** [February 6, 2015, 9:14pm UTC](https://forums.unrealengine.com/t/how-to-properly-set-vector-parameter-value/306214 "2015-02-06T21:14:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Txukie](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Txukie](https://forums.unrealengine.com/u/Txukie)\
**Post date:** [February 6, 2015, 9:14pm UTC](https://forums.unrealengine.com/t/how-to-properly-set-vector-parameter-value/306214/1 "2015-02-06T21:14:09Z")

</div>

Hi,

I’m getting started with UE4 blueprint scripting. I’m using the 2.5D project template and the idea is that I want to change the template character’s colour when I press a button :

- 1 to red
- 2 to green
- 3 to blue

So, I’ve set a Dynamic Material Instance “characterMat” on my creation script.

 ![29210-creation.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/8/2/e8202bbedf93ea4d3b1f3b4efa7f6cfb54616b90.png)

And I’ve used this in my event graph to set the Vector Parameter DiffuseColor to the appropriate value.

 ![29231-eventgraph.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/4/e/d4e7e8becbd1ddc845d1e41311695e50f9ac92b9.png)

This however is not working for me. When debugging I can see the setters being called but it has no effect on the actual game.

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![mindfane](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mindfane/32/710746_2.png) [@mindfane](https://forums.unrealengine.com/u/mindfane)\
**Post date:** [February 7, 2015, 4:42am UTC](https://forums.unrealengine.com/t/how-to-properly-set-vector-parameter-value/306214/2 "2015-02-07T04:42:38Z")

</div>

Try setting the created Dynamic Material instance as the material used by the Mesh (Use Mesh-\>SetMaterial). This goes right after the last node in your first pic.,

It was supposed to work without this, but lets try everything.

---

<div class="post-metadata">

**Author:** ![Txukie](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Txukie](https://forums.unrealengine.com/u/Txukie)\
**Post date:** [February 7, 2015, 10:19am UTC](https://forums.unrealengine.com/t/how-to-properly-set-vector-parameter-value/306214/3 "2015-02-07T10:19:41Z")

</div>

Ok thanks that worked!

---

<div class="post-metadata">

**Author:** ![mindfane](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mindfane/32/710746_2.png) [@mindfane](https://forums.unrealengine.com/u/mindfane)\
**Post date:** [February 8, 2015, 3:16am UTC](https://forums.unrealengine.com/t/how-to-properly-set-vector-parameter-value/306214/4 "2015-02-08T03:16:29Z")

</div>

Happy to help 🙂

Could you mark this thread as solved  
-Thanks

---

<div class="post-metadata">

**Author:** ![Txukie](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Txukie](https://forums.unrealengine.com/u/Txukie)\
**Post date:** [February 10, 2015, 1:04pm UTC](https://forums.unrealengine.com/t/how-to-properly-set-vector-parameter-value/306214/5 "2015-02-10T13:04:43Z")

</div>

Weird… I have already checked your answer as valid, but it doesn’t tag the thread as resolved

---

<div class="post-metadata">

**Author:** ![tmaziero](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tmaziero](https://forums.unrealengine.com/u/tmaziero)\
**Post date:** [June 25, 2017, 6:42am UTC](https://forums.unrealengine.com/t/how-to-properly-set-vector-parameter-value/306214/6 "2017-06-25T06:42:52Z")

</div>

i don’t know how i do this: Use (Mesh-\>SetMaterial). I´m having the same problem.

---

<div class="post-metadata">

**Author:** ![UNRealBrush](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@UNRealBrush](https://forums.unrealengine.com/u/UNRealBrush)\
**Post date:** [May 30, 2018, 9:24am UTC](https://forums.unrealengine.com/t/how-to-properly-set-vector-parameter-value/306214/7 "2018-05-30T09:24:03Z")

</div>

well，I have been reading ArtMaster-I for days,this problem sucked me ,but I found that we just change the DiffuseColor to “BodyColor”, then it worked.  
you know ,it all because of the new UE4 version,it changed!  
I hope I can help the later learner to face this.

---

<div class="post-metadata">

**Author:** ![MisterPixel](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/misterpixel/32/629747_2.png) [@MisterPixel](https://forums.unrealengine.com/u/MisterPixel)\
**Post date:** [May 29, 2023, 11:22am UTC](https://forums.unrealengine.com/t/how-to-properly-set-vector-parameter-value/306214/8 "2023-05-29T11:22:32Z")

</div>

If anyone stumbles across this, go check [this thread](https://forums.unrealengine.com/t/issue-with-material-instances-both-constant-and-dynamic/1175892) for an added layer of weirdness!

As you’ll be able to see, you can do this without any Dynamic Material Instance, which is VERY strange, since the [documentation clearly states it cannot be done](https://docs.unrealengine.com/5.1/en-US/instanced-materials-in-unreal-engine/#:~:text=A%20Material%20Instance%20Constant%20is%20an%20instanced%20Material%20that%20calculates%20only%20once%2C%20prior%20to%20runtime.%20This%20means%20that%20it%20cannot%20change%20during%20gameplay)…
