How to make blueprint interaction affect only one instance I am looking at?

Hi everyone,

I am currently using a blueprint to fade away a decal when I am holding a button down. This works, but the issue is when I create another instance in the level they both fade at the exact same time. My character uses a line trace and sets a hit actor variable which feeds into my interface when I press the corresponding key. Below is the link to the decal blueprint this is affecting.

I have tried creating a material instance on begin play and assigning that material to the decal, which works and creates a MID for each instance. However I am not able to set the opacity on the MID how I need. I am checking in the blueprint to ensure I am hitting the same actor that I am looking at, which returns true and is correct.

I’ve been messing with this for a few days now and feel like it’s something small that is causing the issue. Any help would be great, thanks.

Why not? MPC is like a global param that affects all materials. If you need individual control, MID is the way to go.

I might be doing something wrong but when I create the dynamic material instance and get the reference to it, it doesn’t change the opacity when I try and set the scalar value on it. I haven’t used the MPC on the reference

For reference, here is how I have tried to create the MID and apply it to the decal

I then let my timeline from the blueprint URL fade the material, but it still happens on both instances. I have also dragged the MID reference out and tried to set scalar parameter on Opacity but it does absolutely nothing. Is there something I am missing?

I then let my timeline from the blueprint URL fade the material

Can we see how you do it? And the material itself? I’m under the impression you’re changing the MPC param rather than just the MID’s opacity.

What you’re showing in the script is not ok.

I pasted the blueprint URL above in my initial post, in there is the full code for the blueprint where I fade the material. The material I am using is from Quixel using the blood decals. Here is the material instance:

This is the master material with the MPC set up for opacity:

As expected. This an MPC, a collection param affecting all instances. Use a regular scalar param in the mat and set scalar param via blueprint for the desired instance.

That worked! Thank you, I thought I had tried that but I must have missed a step somewhere.

1 Like