# Issue with Material Instances (both Constant and Dynamic)

**URL:** <https://forums.unrealengine.com/t/issue-with-material-instances-both-constant-and-dynamic/1175892>\
**Category:** Rendering\
**Tags:** unreal-engine, question\
**Created:** [May 23, 2023, 2:04pm UTC](https://forums.unrealengine.com/t/issue-with-material-instances-both-constant-and-dynamic/1175892 "2023-05-23T14:04:40Z")\
**Posts on this page:** 20\
**Page:** 1

<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 23, 2023, 2:04pm UTC](https://forums.unrealengine.com/t/issue-with-material-instances-both-constant-and-dynamic/1175892/1 "2023-05-23T14:04:41Z")

</div>

Hi, everyone!

[The UE documentation](https://docs.unrealengine.com/5.1/en-US/instanced-materials-in-unreal-engine/) **clearly** says that:

1. You should make an Instance of your Material if you wish to customize its parameters individually for achieving multiple looks, as the base Material can only have one global/default “version”.
2. A regular (Constant) Material Instance can only be manipulated via the Material Instance Editor, but if you wish to do this in-game (at runtime), you should make a Dynamic version of it so that you can change its parameters through BP or C++.

Well… I found out that not only can I change **everything** I want at runtime **without** the need of a Dynamic Material Instance, but I actually don’t need **any instance at all**. UE allows me to do **everything, at runtime** , by using **just** the parent Material itself, with no other tricks or exploits whatsoever. Simply use a _Set Material Value_ node from BP and it works! I even made a video, so that you can see exactly what I mean: [https://www.youtube.com/watch?v=obGUpl2w7fw](https://www.youtube.com/watch?v=obGUpl2w7fw)

Can anyone please explain to me what’s going on? Why is this working in the first place and why is the documentation [clearly saying you cannot do this without a Dynamic Instance](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), while in reality you can do it without any issues?

Thank you so much!!!

---

<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:** [May 23, 2023, 3:47pm UTC](https://forums.unrealengine.com/t/issue-with-material-instances-both-constant-and-dynamic/1175892/2 "2023-05-23T15:47:22Z")

</div>

Notice the mouseover hint

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/c/6/8c6337f6c31ef525e59da0166d4db7b06c695458.png)

and the ‘s’

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/b/6/9b64cef9b1265d8ab195f488f717e0630b7264ea.png)

This is for skeletal meshes, I guess.

I don’t know, but I think you’ll find setting params on a bare material like this, very inefficient with large numbers of meshes?

Untested… 🙂

---

<div class="post-metadata">

**Author:** ![Arkiras](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arkiras/32/1008648_2.png) [@Arkiras](https://forums.unrealengine.com/u/Arkiras)\
**Post date:** [May 23, 2023, 7:19pm UTC](https://forums.unrealengine.com/t/issue-with-material-instances-both-constant-and-dynamic/1175892/3 "2023-05-23T19:19:25Z")

</div>

> [@MisterPixel](#):
>
> Well… I found out that not only can I change **everything** I want at runtime **without** the need of a Dynamic Material Instance, but I actually don’t need **any instance at all**. UE allows me to do **everything, at runtime** , by using **just** the parent Material itself, with no other tricks or exploits whatsoever.

This is how it has always worked as far back as I can remember…

I’ve never read that bit of the documentation, but it makes me think of the obvious question: Did you try this in a shipping build? My first thought is that it may be that material instance constants are built only during packaging to reduce shader permutations during development.

---

<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 24, 2023, 9:57am UTC](https://forums.unrealengine.com/t/issue-with-material-instances-both-constant-and-dynamic/1175892/4 "2023-05-24T09:57:03Z")

</div>

Unfortunately it also works with a shipped game. I’ve built & exported everything under a package with the “Shipping” settings applied and when I run the created .exe the same thing happens: everything works perfectly 🧐 This should NOT be happening according to their own documentation and every other tutorial on YouTube out there…

---

<div class="post-metadata">

**Author:** ![Arkiras](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arkiras/32/1008648_2.png) [@Arkiras](https://forums.unrealengine.com/u/Arkiras)\
**Post date:** [May 24, 2023, 2:44pm UTC](https://forums.unrealengine.com/t/issue-with-material-instances-both-constant-and-dynamic/1175892/5 "2023-05-24T14:44:23Z")

</div>

Did you test with a non-dynamic material instance or just a regular material? The regular material, I expect would work fine. I’m more curious about the “material instance constant” as it is something I’ve never heard about until today.

---

<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:** [May 24, 2023, 3:46pm UTC](https://forums.unrealengine.com/t/issue-with-material-instances-both-constant-and-dynamic/1175892/6 "2023-05-24T15:46:02Z")

</div>

Also, be aware, that this

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/2/7/027ec6e566e84e105e2143eabe35ebf3afda5b5d.jpeg)

is not shipping 🙂

It’s a little perk that Epic decided to include in 5. If you can open the console, it’s not a shipping build.

The only way to make a shipping build, is with the launcher

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/d/2/8d222acfa9b37a63f3377b85a571ddb3cb23d864.png)

---

<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 25, 2023, 6:52am UTC](https://forums.unrealengine.com/t/issue-with-material-instances-both-constant-and-dynamic/1175892/7 "2023-05-25T06:52:34Z")

</div>

@Arkiras yep, I have tested with the Material Instance as well. I also didn’t know about the difference until I saw a tutorial, and since that didn’t make sense from my experience, I went to the documentation, which indeed says that I shouldn’t be able to do any of those things (controlling a M or a MIC from BP/code without using a MID).  
@ClockworkOcean that’s the only way in which I’m packaging, through the project launcher! 👍 So, indeed I’ve tested it with a Shipping build, a true one. And _unfortunately_, everything works as it should_n’t_ 🙂

At this point I’m not even sure what to do, who’s wrong or right. Did Epic just put that in the documentation for no reason and made people use a MID for no reason, when all this time you could’ve just done it without, by using a MIC or even M directly? Is this a bug or a feature?

_M = Material_  
_MI = Material Instance_  
_MIC = Material Instance Constant_  
_MID = Material Instance Dynamic_

Source: [the documentation](https://docs.unrealengine.com/5.1/en-US/instanced-materials-in-unreal-engine/)

---

<div class="post-metadata">

**Author:** ![Arkiras](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arkiras/32/1008648_2.png) [@Arkiras](https://forums.unrealengine.com/u/Arkiras)\
**Post date:** [May 25, 2023, 11:42am UTC](https://forums.unrealengine.com/t/issue-with-material-instances-both-constant-and-dynamic/1175892/8 "2023-05-25T11:42:43Z")

</div>

> [@MisterPixel](#):
>
> At this point I’m not even sure what to do, who’s wrong or right. Did Epic just put that in the documentation for no reason and made people use a MID for no reason, when all this time you could’ve just done it without, by using a MIC or even M directly? Is this a bug or a feature?

I doubt it’s a bug as like I said, this has been the case as far back as I can remember. I’ve always viewed material instances as a workflow optimization, and I only used MIDs when I needed unique instances of a material.

This may only affect certain platforms (or some other context which is not mentioned), but most likely I think this is just something that affected the earlier versions of UE4, and the documentation was never updated.

Discovering docs pages that are out of date, lack useful context/detail, or just have incorrect information or important omissions is always demoralizing, but unfortunately it isn’t uncommon.

---

<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 25, 2023, 1:09pm UTC](https://forums.unrealengine.com/t/issue-with-material-instances-both-constant-and-dynamic/1175892/9 "2023-05-25T13:09:52Z")

</div>

> [@Arkiras](#):
>
> I only used MIDs when I needed unique instances of a material.

@Arkiras That’s exactly what confuses me at this moment, cause as you can see from my video, I’m perfectly able to create unique looks for different objects without having to make any MIDs, actually not even MICs (I only use the raw parent Material, which can be endlessly customized without the need of any Instance, be it Constant or Dynamic).

I do not think this is a case of purely outdated documentation, as the MID and MIC blueprint nodes are still there, you can work with them from BP, so they’re still active as though they’re meant for something you can only get by using _them_ alone, yet they are apparently redundant in behavior (or the parent Materials found a loophole and they’re now able to function like Instances, regardless of Constant vs. Dynamic).

Why would they go through the trouble of making Materials, then Material Instances, which then split into Constant vs. Dynamic, when you can do _everything_ by just using Materials alone, from the get-go? I am still unable to find **a single use-case** where Materials are _not_ enough and you need Instances of it, let alone Dynamic ones over Constant.

---

<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:** [May 25, 2023, 1:18pm UTC](https://forums.unrealengine.com/t/issue-with-material-instances-both-constant-and-dynamic/1175892/10 "2023-05-25T13:18:07Z")

</div>

You can’t make a master, apply it to 5 cubes, and then change them all to different colors?

You at least need instances 🙂

Ah

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/7/f/b7ff8d407f4af71e92fa8d9d701e75756475062c.png)

didn’t see that…

---

<div class="post-metadata">

**Author:** ![Arkiras](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arkiras/32/1008648_2.png) [@Arkiras](https://forums.unrealengine.com/u/Arkiras)\
**Post date:** [May 25, 2023, 1:29pm UTC](https://forums.unrealengine.com/t/issue-with-material-instances-both-constant-and-dynamic/1175892/11 "2023-05-25T13:29:47Z")

</div>

> [@MisterPixel](#):
>
> That’s exactly what confuses me at this moment, cause as you can see from my video, I’m perfectly able to create unique looks for different objects without having to make any MIDs, actually not even MICs (I only use the raw parent Material, which can be endlessly customized without the need of any Instance, be it Constant or Dynamic).

Seems you’re correct, I tested in 4.27 as well and it works (at least in PIE, didn’t bother with a shipping build, I just assume it probably works fine)

> [@MisterPixel](#):
>
> I am still unable to find **a single use-case** where Materials are _not_ enough and you need Instances of it, let alone Dynamic ones over Constant.

It does have some workflow benefits. It’s a hierarchy, meaning you can make a change to the parent and it affects all the children. In a toy project like this it’s no big deal to make everything its own material but in a real project with thousands of materials, making low level changes will be brutal without a parent/child relationship.

It also conceals the material logic from artists who might otherwise be tempted to ■■■■ it up.

> [@MisterPixel](#):
>
> Why would they go through the trouble

🤷

---

<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 25, 2023, 1:37pm UTC](https://forums.unrealengine.com/t/issue-with-material-instances-both-constant-and-dynamic/1175892/12 "2023-05-25T13:37:50Z")

</div>

@ClockworkOcean I actually did that in my video, I just used 1x master (parent) Material, with no Instances whatsoever and as you can see, I was able to individually set the Color, Specularity and Roughness to both objects. That clearly shows you can modify the same Material with different parameters, at the same time, for multiple objects, without the need of instances.

@Arkiras The fact that I’m using only 1x master (parent) Material actually still grants me the same workflow benefit 😃 But I know what you’re saying, so ok, let’s say that Material Instances do have _some_ use as far as workflow goes, especially for artists, masking away the implementation and only exposing the needed parameters. **BUT** the whole Constant vs. Dynamic thing is still a huge mystery, as the MID overhead is quite big and at the time of writing this, we both see it makes no difference in either UE4 or UE5, as you can do the same thing with MICs directly, without converting them to MIDs.

---

<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:** [May 25, 2023, 2:03pm UTC](https://forums.unrealengine.com/t/issue-with-material-instances-both-constant-and-dynamic/1175892/13 "2023-05-25T14:03:28Z")

</div>

I just asked a bot, it said

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/a/b/4ab5d6805c24f169b8f1302a938afc5b58309722.png)

🙂

---

<div class="post-metadata">

**Author:** ![Arkiras](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arkiras/32/1008648_2.png) [@Arkiras](https://forums.unrealengine.com/u/Arkiras)\
**Post date:** [May 25, 2023, 2:12pm UTC](https://forums.unrealengine.com/t/issue-with-material-instances-both-constant-and-dynamic/1175892/14 "2023-05-25T14:12:45Z")

</div>

> [@MisterPixel](#):
>
> The fact that I’m using only 1x master (parent) Material

This sounds like a disaster, but that’s a different topic :U

I’d also like to know what the deal is with M/MIC/MID so if you figure it out, please update us

---

<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 25, 2023, 2:13pm UTC](https://forums.unrealengine.com/t/issue-with-material-instances-both-constant-and-dynamic/1175892/15 "2023-05-25T14:13:09Z")

</div>

@ClockworkOcean Hmm, first of all, where did you get the Bot from? I want to use that as well 😃 Second of all, his first paragraph tells me that a MI (which, by default is a MIC according to the documentation) is better than a MID, while the second paragraph concludes by saying that a MI is better than dynamically changing the parameters of a single material (which implies the regular, non-instanced parent Material). I think it confused 2 very different concepts due to the subtle wording difference: _dynamic material instance_ **(MID)** vs. _dynamically changing a material_ **(M)**.

@Arkiras I only used 1x parent Material to prove that it can be done, not saying it should be done like this. But as long as [the docs](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) and all YT tutorials out there are saying it _cannot_ be done like this, when I’m clearly showing that it _can_… this thing **really** bothers me… 🧐

---

<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:38am UTC](https://forums.unrealengine.com/t/issue-with-material-instances-both-constant-and-dynamic/1175892/16 "2023-05-29T11:38:36Z")

</div>

> [@ClockworkOcean](#):
>
> Notice the mouseover hint

@ClockworkOcean I took a closer look at the documentation and had to go back to the hints you dropped in your post. Please, let me know if I understand this correctly… When we go to the [node doc](https://docs.unrealengine.com/5.1/en-US/BlueprintAPI/Rendering/Material/SetScalarParameterValueonMateria-/), we see the following (notice the _Italic_ font):

> [Set Scalar Parameter Value on Materials](https://docs.unrealengine.com/5.1/en-US/BlueprintAPI/Rendering/Material/SetScalarParameterValueonMateria-/) - Set _all occurrences_ of Scalar Material Parameters with ParameterName in the _set of materials_ of the _SkeletalMesh_ to ParameterValue. Target is Mesh Component.

Does this mean that the drawback of using this method is that:

1. it only works on Skeletal Meshes?
2. if my mesh has more than 1x Material applied and by coincidence I have the same parameter name in 2x or more materials, it will automatically set all of them to the same value in bulk?

Cause that might explain why my solution would have some drawbacks, although it still doesn’t answer my earlier question from the last few posts (why we’re able to do this despite [the docs](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) saying only MIDs can change things during gameplay at runtime).

---

<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:** [May 29, 2023, 12:34pm UTC](https://forums.unrealengine.com/t/issue-with-material-instances-both-constant-and-dynamic/1175892/17 "2023-05-29T12:34:15Z")

</div>

1: No

2: Yes, I would think.

I think it’s a little bit like ‘get all actors of class’, but ‘get all materials on mesh’

🙂

---

<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:** [July 4, 2023, 6:23pm UTC](https://forums.unrealengine.com/t/issue-with-material-instances-both-constant-and-dynamic/1175892/18 "2023-07-04T18:23:46Z")

</div>

Back with some updates. Just when I thought I’d be able to solve it, I ran into even more things that contradict the documentation, as well as common sense 🙂 As tradition would have it, I made a Part 2 video, explaining everything:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/0/d/e0d6ff8c7493d6b3e944ae6164bd217a3dfae83e.jpeg "(Part 2/2) UE issue with Materials vs. Instanced Materials (both Constant and Dynamic)") ](https://www.youtube.com/watch?v=ul8qg3JcUrw)

---

<div class="post-metadata">

**Author:** ![Chosker](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chosker/32/710746_2.png) [@Chosker](https://forums.unrealengine.com/u/Chosker)\
**Post date:** [July 4, 2023, 9:12pm UTC](https://forums.unrealengine.com/t/issue-with-material-instances-both-constant-and-dynamic/1175892/19 "2023-07-04T21:12:05Z")

</div>

If you look at MeshComponent.cpp and look for:  
`void UMeshComponent::SetVectorParameterValueOnMaterials(const FName ParameterName, const FVector ParameterValue)`  
you will see that the code for the “Set Vector Parameter Value On Materials” BP node actually creates a MID :

```auto
UMaterialInstanceDynamic* DynamicMaterial = Cast<UMaterialInstanceDynamic>(MaterialInterface);
				if (!DynamicMaterial)
				{
					DynamicMaterial = CreateAndSetMaterialInstanceDynamic(MaterialIndex);
				}
				DynamicMaterial->SetVectorParameterValue(ParameterName, ParameterValue);

```

so to make it clear: by using this method you are **not** editing the Material/MIC directly.  
the documentation is still correct, it’s your conclusions that were skewed by this fact 🙂

---

<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:** [July 4, 2023, 9:25pm UTC](https://forums.unrealengine.com/t/issue-with-material-instances-both-constant-and-dynamic/1175892/20 "2023-07-04T21:25:29Z")

</div>

Just for reference, in case anyone wonders what node you’re talking about in the previous post, it’s this one:

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/3/7/1373812e5f6ce7e593f2c09649c791ea651ae13a.jpeg)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/3/a/13a9b98cfcbe0fca8774088fbb76e3424f9d21d8.png)

Hmm, very interesting… I was hoping that would ultimately be the solution, as the only possible explanation in my mind would have been some sort of implicit cast or similar things happening behind the scenes. This would also explain why I’m able to retain the behavior separation when editing the Material directly (or so I thought) for multiple meshes and why this doesn’t happen when explicitly creating 1x MID that then gets used by multiple meshes 👍. I hope the reasoning of this last statement of mine was sane enough this time (boy, oh boy, I just made a rhyme 😃).

[Next page](https://forums.unrealengine.com/t/issue-with-material-instances-both-constant-and-dynamic/1175892.md?page=2)
