'If' node in Material Editor doesn't work as expected

Hello,
I wanted to make a Material Function, that returns me a Material, corresponding to a float, which is passed as an argument. A kind of ‘getMaterialByIndex’ method.

When using this Function, it seems to return a float.

From which I’ve concluded, that the ‘If’ node returned this float.
But according to the Documentation, it should return the Material Attributes. At least that is what I’ve expected.
Is that a Bug or am I doing something wrong? And what can I do in order to get the Attributes?

Hello Pro-Gaming-ID,

So looking through your setup you are attempting to pass scalar parameter values into a vector node. IE passing the function and Scalar value into the BreakMaterialAttributes. By passing the function through a switch set to true before passing that to your MaterialAttribute should fix this issue.

Thank you, that worked immediately. =)