Apply Dynamic Material Instance to multiple Static Mesh Components

Hello!
I have created a Blueprint that has multiple meshes with different types of materials applied to them. I have applied a Fade Affect to it, but I can’t seem get it to work for multiple meshes. Started messing with Make Array node, but it just applies the affect to the next index I insert and not all the meshes. I have tried connecting the Array Index to the Element Index node but still have the same issue. I would appreciate it if someone would help me solve my issue. Maybe I am not using the right approach.

You just need to make the dynamic MI once, then apply it to all meshes. You don’t need to make one for each mesh.

I see in your ‘multiple example’, you’re making the MI in the loop. So, when it runs for item 2, the instance for item 1 has already be lost.

Like I say, only 1 instance needed :slight_smile:

1 Like

Hey ClockworkOcean!
I get this error message when connecting ‘For Each Loop’ Array Element to the ‘Set Material’ Target. Is it because these are static mesh components or possibly because I have my Meshes Variable as Static Mesh Component? If so, how can I remedy this?

You have to remake the set material node by dragging from the loop. You can’t reuse old nodes :slight_smile:

I did not reuse, created a new one. Also, not sure if you come across this, but When I created the Mesh Array I was able to search for components but now nothing is there to search. Create another mesh array to test for search but I get the same issue. Any idea?

I think you’ve set it as a ‘static mesh component ref’, rather than ‘static mesh actor ref’

When I set it to ‘Static Mesh Actor’ my search option is grayed out.

This is what I had set it to before.

Ok, so figure out instead of selecting Static Mesh I was using Static Mesh Component. Still trying to get the Blueprint to work. If I Still can’t get it to work I will hit up later.

Static mesh component should do the trick. Works for me

I have converted a group of Static Mesh to a Blueprint, so yes the meshes are in the BP.

This is my fade in/Fade out setup control:

For Variables I have:

image

Setup for Dynamic Material Instance:

Still having the same Issues here with Mesh Variable set to ‘Static Mesh’:

What I am trying to achieve is to Fade in / Fade out with a key all the meshes within the blueprint. Keep in mind that I have different materials applies on those meshes.

I think it’s like I said in the beginning, you need to remove this node

image

drag from here, and type ‘set material’

image

I still get the same error message when applying that node through Array Element.

Nothing pops up.

What do you get when you mouse over the array variable?

I had Static Mesh Component before but it did not like connecting to the ‘For Each Loop’ Array pin. I can send a pic if you’d like?

It’s the same problem.

You have to make the nodes new every time.

Drag off the array and make a new loop :slight_smile:

So I have to change my Variable back to ‘Static Mesh Component’ instead of just ‘Static Mesh’? Also when I have the ‘Static Mesh Component’ as array the search is blank as shown before.

This is my option with my Variable set to Static Mesh Array:

It’s just an array of static mesh components. You can put them in a loop and set the material. That’s it :rofl:

:rofl: I am probably over thinking this. First year messing with Unreal. Eventually, it will click. :rofl: I’ll mess with it at home later tonight. If not, you’ll be hearing from me tomorrow. :rofl: Thanks for your time and help ClockworkOcean.

1 Like