Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. We are looking for your feedback about Templates! Tell us about your experiences by taking our survey.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Resolved Invalid conditional expression in custom function

Discussion in 'Shader Graph' started by Chris-Trueman, Jan 22, 2021.

  1. Chris-Trueman

    Chris-Trueman

    Joined:
    Oct 10, 2014
    Posts:
    971
    I am following https://blogs.unity3d.com/2019/07/31/custom-lighting-in-shader-graph-expanding-your-graphs-in-2019/.

    I add the custom function and set it up as shown. With the first method using a string it gives me Invalid condition expression when I hover over the little red folder icon with an exclamation point on it and the console outputs this error:

    MissingMethodException: UnityEngine.UIElements.StyleLength UnityEngine.UIElements.ComputedStyle.get_width()
    UnityEditor.Experimental.GraphView.IconBadge.ComputeTextSize ()

    If I switch it to the hlsl file method it gives the same error above but I get a second error that tells me where it is in the hlsl file. It points the the first { which is for the method declaration, there is no conditional expression defined at that point.

    Did something change, or is this a bug?

    Using 2020.2.0f1 and URP 10.2.2.
     
  2. Chris-Trueman

    Chris-Trueman

    Joined:
    Oct 10, 2014
    Posts:
    971
unityunity