BP - Set material parameter for every element of array

Hey there,

I’d like to set a material instance parameter for every element of an array.

My use case: I’m setting the emissive color for an array of objects based on the distance to another object. Right now all elements of the array are using the same material instance. This causes all objects to have the same emissive color. But some objects are closer then others. Closer objects should have a brighter emissive color.

This is what I have by now:

Could someone please give me a hint what I’m doing wrong?

Best,

Huppys

I assume you want each material to have its own value.

From what I can see, you’re using a material parameter collection. Those values are shared globally with any material using that collection. In your material, you will have to create a Scalar Parameter node. Then in your blueprint code above, you have to get the new material instance in the loop and Set Scalar Parameter on it.

Alright, I’ll rework this. Give me a second.

I got it, thank you Denny.

This is what my blueprint looks like now. It just works fine.