Subgraph error

Hello,

I have a Material that uses Shader created by Shader Graph. Let’s call it a base.
I want to add a pattern to my object on top of base Shader, I’ve created new Shader and Material from it.
I tried to apply it to my Mesh Renderer and it gives me “This renderer has more materials…”, ok.

I remembered that there’s a feature called “Subgraph” and I thought that this will be a great thing, I could use my base Shader as a Subgraph and then just call it in other Shaders to apply, like, pattern to it. Is this a right usage for Subgraphs?

I tried doing this but I get an error:

Is it me? Am I just don’t understand how it supposed to work?

Can you try create new graph from scratch, and then create subgraph?

I have experienced similar issue occasionally.
Restarting Shader Graph, Unity, or even recreating graph sometimes help.

I figured it out, I don’t know why, but I gave all of my subgraph variables under score “_” to their reference names. if someone could explain why this worked I will be grateful.

Hmm. Technically unless you use some specific keyword variables, that shouldn’t matter.
What if you remove “_”, will it break again? Or if works, maybe some variable name ref wasn’t updated correctly?

Ok, I just checked “_” has nothing to do with this issue. Moreover, all nodes in subgraph show this error, buuuut when I use this subgraph in shader graph everything is ok.