Download

Why is Dynamic Material Instance not working :(?

Hi, i want to change a certain parameter in a material instance once i do a certain action with a character but it doesn’t work

the material instance itself is a part of an emitter that i spawn with the character

is there any reason it might not work?

does the material instance needs to be in a certain blueprint or is it Ok i used it inside my Character blue print?

the material instance itself in not in the blue print but only in the construction script on the create Dynamic material instance node

If you’re applying a dynamic material instance to a mesh, you have to use a Set Material node targeting it, after you set parameter values. If you alter the parameter values further, you don’t have to use set material again.

As your variable names would suggest, if you’re trying to apply the material to a particle system, you need a couple extra things.

In the main tab of your particle system, you need a named material slot.

In the required tab of your emitter, you need a named material override with the same name.

In a blueprint where your particle system is found/spawned, in your particle system details, under particles, you need to add an instance parameter with the same name.

Then, instead of using Create Dynamic Material Instance, use Create Named Dynamic Material Instance, with the particle system as your target, and In Name set to the instance parameter name.

Finally, instead of using a Set Material node use Set Material Parameter node. Use the particle system as your target, with the instance parameter name, the named dynamic material instance.

I’m sorry for the bother but i didn’t understand the explanation perhaps it is the late hour but mind you help me understand further?

i appreciate the help

Please refer this:

Key point here is that after creating a Dynamic Material Instance, you should apply it as the active material of your static mesh(or particle system). So use the ‘Set Material’ node to change the material of your mesh to the created dynamic material instance. If you don’t do that, the mesh(or particle system) will be using the original material it had and changing the parameters of the instance will have no effect.

after a i had a good night sleep i understood what you were trying to tell me but a few things

“In the** main tab of your particle system**, you need a named material slot” i don’t understand what"main tab of your particle system" is referenced to

and when i add an instance parameter name in the particle system details there is only a vector or a random vector options, what if i want the vector value to be a mesh’s worldpostion?

and what i got is something like that and it still doesn’t work any idea what i did wrong?

I think ppl need a better context of wal hat you are trying to accomplish.

I have a Warping affect made by a material’s absolute world position and i need to change a 4 values vector in order to operate it correctly

I applied the affect to 2 materials that I use in my particle emitter,this emitter i spawn trough: spawn emitter attached

I need that emitters material instances to change that 4 value vector according to the values I give it during the game session so i came to the conclusion that i need an MID(Material instance dynamic)

and I am having a hard time making it work so i need your guys help :slight_smile:

Bumping it because i really need your help :frowning:

https://youtu.be/i2XmTbfIJ3s

I’m not sure I understand what the affect is going to do.

Something needs to drive the change in the instance.

yeah i already used this video and it doesn’t work either
and this is the affect that i want to make: https://www.youtube.com/watch?v=MSVf3djHdK0

only i am not making it on the character and i don’t want to use a fixed location for where the warping happens

I want to be able to apply my controller location as the collapse location and and then to use a length vector to change the Size parameter

is it really that hard to make a dynamic material instance :?

In the last image you posted Set Material Parameter should use the same parameter name as Create Named Dynamic Material Instance, the param should be set to the return value of Create Named Dynamic Material instance.

Still doesn’t work

I should have been more specific, both should be M_IB_Swipetrailbow_Inst. Make sure Plasma Bow PE Small Warp, in your blueprint, has an Instance Parameter called M_IB_Swipetrailbow_Inst. And that the particle system itself has a Named Material Slot with named M_IB_Swipetrailbow_Inst, and a Named Material Override named M_IB_Swipetrailbow_Inst.

Don’t forget to set your source material on Create Named Dynamic Material Instance.

alright i understood all but one thing

what is a name named material slot and how do i make it?

**-Edit-
i found it and did what you told me to but it only affects the emitter i placed in the blueprint in order to link it to the “Create name dynamic material instance” and i doesn’t affect the emitter i spawn using “spawn emitter attached”

how can i make it apply to a spawned emitter?

and also it changed the emitter itself there is a reason or i did something wrong?**

It’s in your particle system’s main tab. Not in any of the emitter’s tabs.
07ac2faf8af9b8efadaa07d10e2b2ca310e27c91.jpeg

-Edit-
i found it and did what you told me to but it only affects the emitter i placed in the blueprint in order to link it to the “Create name dynamic material instance” and i doesn’t affect the emitter i spawn using “spawn emitter attached”

how can i make it apply to a spawned emitter?

and also it changed the emitter itself there is a reason or i did something wrong?

it also doesn’t change what i specified in the “set vector parameter”
it as if it changed the material but it doesn’t apply any input the emitter even looks different

also when i use material override i get this error and mesh materials gets an X on it:

Never tried it with spawn emitter attached before. Instead of using a Set Material Parameter node, try using something like this:

f42d2c1ce5095f071c590da4b7a60b8f5fbe3a4b.jpeg

You’ll need to Make ParticleSystemParam for each parameter.

Edit: no idea what to do about the mesh materials.