# How to access a material instance variable from a blueprint object in Unreal Engine?

**URL:** <https://forums.unrealengine.com/t/how-to-access-a-material-instance-variable-from-a-blueprint-object-in-unreal-engine/475565>\
**Category:** Rendering\
**Tags:** parameters, unreal-engine, Blueprint, question\
**Created:** [December 7, 2020, 7:28pm UTC](https://forums.unrealengine.com/t/how-to-access-a-material-instance-variable-from-a-blueprint-object-in-unreal-engine/475565 "2020-12-07T19:28:00Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![venomtail](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@venomtail](https://forums.unrealengine.com/u/venomtail)\
**Post date:** [December 7, 2020, 7:28pm UTC](https://forums.unrealengine.com/t/how-to-access-a-material-instance-variable-from-a-blueprint-object-in-unreal-engine/475565/1 "2020-12-07T19:28:00Z")

</div>

I have a texture material that changes between 2 textures. This change can be controller by a variable. I’ve made a material instance from this material as well as a blueprint that has an object in it, to which this MI texture is applied to. I was hoping to update the materials variable parameters through the blueprints event tick but I am having difficulties figuring out how to access this parameter.

Would anyone know what has to be done in blueprint to access parameters and change them?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [December 7, 2020, 10:38pm UTC](https://forums.unrealengine.com/t/how-to-access-a-material-instance-variable-from-a-blueprint-object-in-unreal-engine/475565/2 "2020-12-07T22:38:28Z")

</div>

It’s this for texture:

 ![324256-screenshot-1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/7/6/e76f89c65c32bc35395d193c9189c3717c818e70.jpeg)

There’s also scalar and vector.

---

<div class="post-metadata">

**Author:** ![venomtail](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@venomtail](https://forums.unrealengine.com/u/venomtail)\
**Post date:** [December 7, 2020, 11:06pm UTC](https://forums.unrealengine.com/t/how-to-access-a-material-instance-variable-from-a-blueprint-object-in-unreal-engine/475565/3 "2020-12-07T23:06:54Z")

</div>

So this is the parameter I am trying to change in the blueprints. But I seem to be struggling.

![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/9/2/89262886cf2ca73fc2e8aa3f56720da96f0b2112.png)

And I tried to follow your images of how to do the blueprint script but I’m not even getting permissions to

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/4/e/44efccb7c0736ddb8111bc7c8367369590fd49fe.png)

Do you know what else could be there? What one piece am I missing? I’m completely new to UE4 as well.

---

<div class="post-metadata">

**Author:** ![Fenther586](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Fenther586](https://forums.unrealengine.com/u/Fenther586)\
**Post date:** [December 8, 2020, 2:51am UTC](https://forums.unrealengine.com/t/how-to-access-a-material-instance-variable-from-a-blueprint-object-in-unreal-engine/475565/4 "2020-12-08T02:51:38Z")

</div>

It looks like “Character material” isn’t a dynamic material instance. As far as I know you can only set parameter values from those. So if you dragged off the return value pin from the “Create Dynamic Material Instance Node” you would then be able to see the set/get parameter values.  
Also if you were wanting to change the contrast parameter you would want to use Set Scalar Parameter Value.

Hope this helps

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [December 8, 2020, 8:58am UTC](https://forums.unrealengine.com/t/how-to-access-a-material-instance-variable-from-a-blueprint-object-in-unreal-engine/475565/5 "2020-12-08T08:58:35Z")

</div>

There’s a lot happening in there that does not seem right:

- don’t forget to choose an actual material from the dropdown to make an instance out of
- you can create references easily like so:

[![Image from Gyazo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/4/7/c4733d2c2af81f7ce972a020826100827f3f43a8.gif)](https://gyazo.com/2d1c55995d4646ca74b722b5d07286fd)

- you will need to also assign this material to something (top bit):

 ![324274-screenshot-2.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/4/e/b4e2069a5b9907ce418c1c04d506c392a0c86a94.jpeg)

- and it can be controlled like so (bottom bit)

---

<div class="post-metadata">

**Author:** ![venomtail](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@venomtail](https://forums.unrealengine.com/u/venomtail)\
**Post date:** [December 8, 2020, 11:14am UTC](https://forums.unrealengine.com/t/how-to-access-a-material-instance-variable-from-a-blueprint-object-in-unreal-engine/475565/6 "2020-12-08T11:14:58Z")

</div>

Thanks. I didn’t know I can just straight promote it on the right side of the box. I think I was meant to say material? I have a material that has 2 textures in it, and a variable that controls the constrast between them.

And once I have my parameter name the same as the parameter’s name is in the material, how would I then take and alter this parameter inside the blueprint? Is there a way to call it? Or do I have to promote the parameter to a variable and then call that?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [December 8, 2020, 12:05pm UTC](https://forums.unrealengine.com/t/how-to-access-a-material-instance-variable-from-a-blueprint-object-in-unreal-engine/475565/7 "2020-12-08T12:05:10Z")

</div>

![324313-screenshot-1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/0/5/30547793b57b3db34715724fa439ca5dda39a447.jpeg)

It’s literally this, I believe you’re overthinking things.

---

<div class="post-metadata">

**Author:** ![MasterMLF](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MasterMLF](https://forums.unrealengine.com/u/MasterMLF)\
**Post date:** [May 16, 2022, 10:49am UTC](https://forums.unrealengine.com/t/how-to-access-a-material-instance-variable-from-a-blueprint-object-in-unreal-engine/475565/8 "2022-05-16T10:49:46Z")

</div>

Hi! Sorry to bother you, but is there a way to do it for material instance and if so how?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [May 16, 2022, 10:50am UTC](https://forums.unrealengine.com/t/how-to-access-a-material-instance-variable-from-a-blueprint-object-in-unreal-engine/475565/9 "2022-05-16T10:50:54Z")

</div>

Do what exactly to the material instance?

---

<div class="post-metadata">

**Author:** ![MasterMLF](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MasterMLF](https://forums.unrealengine.com/u/MasterMLF)\
**Post date:** [May 16, 2022, 12:09pm UTC](https://forums.unrealengine.com/t/how-to-access-a-material-instance-variable-from-a-blueprint-object-in-unreal-engine/475565/10 "2022-05-16T12:09:58Z")

</div>

It’s hard to explain around here, I wanted to send pictures. can you tell me your email?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [May 16, 2022, 12:16pm UTC](https://forums.unrealengine.com/t/how-to-access-a-material-instance-variable-from-a-blueprint-object-in-unreal-engine/475565/11 "2022-05-16T12:16:02Z")

</div>

No, but you can send pictures here.

---

<div class="post-metadata">

**Author:** ![MasterMLF](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MasterMLF](https://forums.unrealengine.com/u/MasterMLF)\
**Post date:** [May 16, 2022, 12:20pm UTC](https://forums.unrealengine.com/t/how-to-access-a-material-instance-variable-from-a-blueprint-object-in-unreal-engine/475565/12 "2022-05-16T12:20:03Z")

</div>

says that new users cant send images. do you know other way to talk to you?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [May 16, 2022, 1:05pm UTC](https://forums.unrealengine.com/t/how-to-access-a-material-instance-variable-from-a-blueprint-object-in-unreal-engine/475565/13 "2022-05-16T13:05:23Z")

</div>

Describe what’s needed. I think you can attach a single image per post initially.

---

<div class="post-metadata">

**Author:** ![MasterMLF](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MasterMLF](https://forums.unrealengine.com/u/MasterMLF)\
**Post date:** [May 16, 2022, 3:50pm UTC](https://forums.unrealengine.com/t/how-to-access-a-material-instance-variable-from-a-blueprint-object-in-unreal-engine/475565/16 "2022-05-16T15:50:49Z")

</div>

I want that in the blueprint that on click change the Texture\_Mask to the one I define.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/c/a/1caa5ff0d42aa1b4f99b5b962860f2ee11ec4463.jpeg)

---

<div class="post-metadata">

**Author:** ![Devic.a](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/devic.a/32/483895_2.png) [@Devic.a](https://forums.unrealengine.com/u/Devic.a)\
**Post date:** [May 16, 2022, 5:01pm UTC](https://forums.unrealengine.com/t/how-to-access-a-material-instance-variable-from-a-blueprint-object-in-unreal-engine/475565/17 "2022-05-16T17:01:21Z")

</div>

Hello,  
If I understand this right, you are looking for material parameter collection.  
Take a look at the documentation [Material Parameter Collections | Unreal Engine Documentation](https://docs.unrealengine.com/4.27/en-US/RenderingAndGraphics/Materials/ParameterCollections/)  
Basically via this you can change the mask texture of the material, individually.

---

<div class="post-metadata">

**Author:** ![MasterMLF](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MasterMLF](https://forums.unrealengine.com/u/MasterMLF)\
**Post date:** [May 17, 2022, 4:46pm UTC](https://forums.unrealengine.com/t/how-to-access-a-material-instance-variable-from-a-blueprint-object-in-unreal-engine/475565/18 "2022-05-17T16:46:30Z")

</div>

thanks, but it’s not like that. I want that when clicking on a widget button of a blueprint it will change that Texture\_Mask to another one and not desaturate it

---

<div class="post-metadata">

**Author:** ![Devic.a](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/devic.a/32/483895_2.png) [@Devic.a](https://forums.unrealengine.com/u/Devic.a)\
**Post date:** [May 17, 2022, 6:17pm UTC](https://forums.unrealengine.com/t/how-to-access-a-material-instance-variable-from-a-blueprint-object-in-unreal-engine/475565/19 "2022-05-17T18:17:09Z")

</div>

Yeah that was just a demonstration of how it can be used. But now I am not sure, you want to change the mesh or the material instance?

---

<div class="post-metadata">

**Author:** ![MasterMLF](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MasterMLF](https://forums.unrealengine.com/u/MasterMLF)\
**Post date:** [May 18, 2022, 10:02am UTC](https://forums.unrealengine.com/t/how-to-access-a-material-instance-variable-from-a-blueprint-object-in-unreal-engine/475565/20 "2022-05-18T10:02:42Z")

</div>

sorry my mistake, I meant Texture\_Mask (The one that appears in the image I sent above). But thank you very much for the help, but i already managed to solve my problem!
