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.
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.