Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Create Custom Node Source file

Discussion in 'Scripting' started by miscanadian, Jul 5, 2022.

  1. miscanadian

    miscanadian

    Joined:
    Jan 21, 2017
    Posts:
    4
    I am trying to make a Custom Node but I cannot stand using the string text editor. Any line that overflows on a tiny little square makes it literally impossible to select a line and insert text. So I need to create the file.

    I looked at this page and it does not tell me how to create the file.
    https://docs.unity3d.com/Packages/com.unity.shadergraph@6.7/manual/Custom-Function-Node.html

    So I made a text file with .hlsl file extension. That is not accepted for the source file. It has to be a .cginc file. So I make it that instead. File can be used.

    After failure, I look at this tutorial and copy his function. But he created an hlsl file.


    All I get is "Undeclared Identifier MyFnc_float_float at line 196" with his function.

    Every tutorial I've found are 2-3 years old using C# for custom nodes which is not supported anymore. On top of that

    I don't understand what is wrong, what changed and where can I find working tutorials for this.
     
    Last edited: Jul 5, 2022
  2. Fluttershy28

    Fluttershy28

    Joined:
    Jan 15, 2018
    Posts:
    37
    same problem here still looking up for a solution
     
  3. Fluttershy28

    Fluttershy28

    Joined:
    Jan 15, 2018
    Posts:
    37
    just found the solution in case someone still have this issue, the problem is in the Windows not unity. to fix it:
    Search for "File Explorer Options" on start menu and click it. A pop up windows should appear.
    Click on the second Tab "View".
    Locate tho option called "Hide extensions for known files types" and Unable it.
    Hit Apply and head back to the hlsl file.
    You should see now that the hlsl wasn't actually the extension, just rename properly and should work just fine.
     
    CarlosssBlanccc and Kurt-Dekker like this.
  4. CarlosssBlanccc

    CarlosssBlanccc

    Joined:
    Jun 17, 2023
    Posts:
    1
    You just saved my life THANKS SO MUCH!!!!