Can Dynamic Material Instance effect only one object using a particular material instance

If you have a lot of similar BP actors, and they’re all glowing. Then you need to add a flag variable to the BP ‘glow’. And only set the instance to glowing if the glow bool is checked :slight_smile:

I want to be able to have a glow around an object when player points towards it in a VR game. I setup the master with what i need, but as the material instance is used on many other objects in the level and the multiple other instances of the object in question, when i activate it in blueprints it makes everything that uses that one material glow… Without creating a unique material instance for each object, is there another way to make the dynamic material changes just effect one of the objects using that instance ?

If you want it to glow on one object under certain circumstances, you make a dynamic instance in the BP for that object. Then when you update it, it only applies to that one object.

Thats what ive done, but its making everything in the level that is using the material instance its based off glow

“when i activate it in blueprints it makes everything that uses that one material glow” – how exactly do you do that? Is it possible that you activate all the actors of this type at once instead of just one? The interaction must be happening in the Character BP, can you show a screenshot of that?

it rather large but its taken of a sphere trace result using element hit actor and then casting to the actor to confirm it is hitting it

im using sphere trace result, so set a ‘can glow’ bool and use it on a branch node then set parameter if true?

Okay, you cast to that actor, and then you call the function in that actor? Or what do you do after you confirm that it’s the actor you need?

After cast i set a bool varible that is used to allow a lerp to object and another that stores object in game inst, the last thing i do i call function

Yeah, I may know what the problem is. Although I still don’t under how they all start glowing when you activate only one, because the way you create dynamic materials should not be working at all.

What I mean is there are two ways to create a dynamic material. First, is to take is from the mesh directly, like this:

The second way is the one that you use – you reference the material that just exists in your project. But in your case, the dynamic material remains only a variable in your BP, and no matter how many times you change that variable, your mesh remains the same because you never assigned your dynamic material to your mesh.

What I think is happening in your case: the existing materials in the actors are never changed to dynamic ones, and the default ones are just glowing as they are.

1 Like

Thanks you are spot on, been a while since i used dynamic material and i just right clicked in graph and brought it up forgetting about this caveat, it works as intended now