Scalar parameter value with same names in material. How to properly use it?

Hi guys :slight_smile:

So. 1 material. In many place in that material i use some scalar value, for example - “my_scalar_value”.
If you just create another copy of that scalar node and name it the same way -> “my_scalar_value” - every changes of that scalar value trougth BP will affect every “copy” of “my_scalar_value” inside material, which are complitely expectedly.

But is that normal and proper way to doing this? In BP its totally okay, but i just dont 100% sure about material editor.

Hello, I did a test/observation myself.

Setup:
I created a test project -> 1 material -> One Vector3 param(Made sure it was converted into a parameter) -> Select it -> Copypaste.
Now we have 2, vector3 parameters with the same name.

Testing:
Change Color on one of them -> Compile/Apply -> Both changes to the same Color.

Conclusion:
It is most likely just being considered as the same variable which in comparison to BP would be like using the same variable in two places.
I am not sure what you refer to when you ask if it is a proper way of doing things as it depends on what you want to archive but I make the assumption that it is an intended feature that can be used without any worries.

I am sorry if I did not give you the answer you expected or needed.

It is the same variable.
instead of having noodles everywhere you can use the same scalar in multiple places without a performance impact.
it’s literally just a variable.

1 Like