Search Unity

Question Custom Function Error upon output variable creation

Discussion in 'Shader Graph' started by Kupferrot, Apr 3, 2021.

  1. Kupferrot

    Kupferrot

    Joined:
    Jan 19, 2014
    Posts:
    47
    Hello People,

    I wanted to learn something about shaders, so I watched some tutorials. However I immediately get an error if I try to use a Custom Function.

    The Custom function is telling me, that I need at least one Output-Variable. But as soon as I create one, I start
    getting errors. Please have a look at this screenshot:
    Unbenannt.PNG

    Is this a known issue or am I missing something? As soon as I create the Output nothing works anymore.
    I am using unity 2021.1.0f1
     
  2. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,553
    Hi,

    Just try to add valid shader code to the source slot and see if the problem persists. Try some of the examples in the manual? It should work ok, and the errors usually go away when you got the code syntax correct and all the inputs and outputs assigned, and in correct order.
     
  3. Kupferrot

    Kupferrot

    Joined:
    Jan 19, 2014
    Posts:
    47
    Hello Olmi,

    EDIT:
    After setting the code in body as you suggested, it was working.

    Thank you very much
     
    Last edited: Apr 6, 2021