MaterialInstanceDynamic(MID) and MaterialParamCollection(MPC) inside ForLoop
Could someone help me figure out why neither MIDs or MPCs pass parameters correctly to a DrawMaterial call when inside a ForLoop?
The array of floats being used to pass values to both the MID and MPC setups contain 3 values: 0.0, 0.5 and 1.0.
In the MPC example all three loop iterations are black. I don't think the array value is being passed to the material for some reason.
Hey ash22 -
Material Parameter Collections is not the way you want to do this particular type of call. MPCs are meant to change a particular variable in multiple materials to the same value. The individual Materials that use the MPC cannot have different values.
Your first method was correct but you should move your MID creation into your loop that way each of your draw material calls can have a different value otherwise the same issue as with an MPC arises and you are assigning the same material each time and change the value each time so the last time it is called it sets all three because each is using the same material.
Here is a corrected BP, note I removed your Construction Script and the VID variable as unneeded:
answered Dec 16 '14 at 08:50 PM
Lovecraft_K ♦♦ STAFF
Follow this question
Once you sign in you will be able to subscribe for any updates here