I suppose it happens, because ue doesn’t know which material it should change, so if I’ll assign same material for 2 material slots I’ll change value for 2 materials. How can I bypass this problem? I want to change values separately? I think there should be something like arrays of this values…
You are using scalar values as custom data. They only have 1 value so if you have index 0 and 1 as the parameters, then only custom data index 0 and 1 work.
You would need to either have more parameters to fill in the next indexes of the custom data fields or use something like a vector if you want colors
(note that vectors have larger offsets so the next index would be the amount of pins in the vector)
You can always use the debug float node to show if the values are working inside of the material by setting it to the base color.
You want two vector parameters both in separate materials and both need to have custom primitive data turned on.
The first one can have index 0 as it’s the first material
The second one needs to have it’s index offset by the amount of inputs inside of the first materials custom data node.
So if the first material starts with an index of 0 and is a vector 4 the it takes up 0,1,2,3 => so the next available index is 4 so have your second material’s custom index data start from 4.
Then when once you hook up the data just add the indexes and values in the custom data of the primitive.
The slot order doesn’t matter the custom index inside of the materials is what dictates what parameter it gathers from.
If you have the same materials instance one under the next then they will both use the same index internally so they will have the same value as the index is inside of the material.