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. Dismiss Notice

[Released] uNode - Visual Scripting [Support C# Import/Export]

Discussion in 'Assets and Asset Store' started by wahid_rachmawan, Oct 18, 2017.

  1. gomotimius

    gomotimius

    Joined:
    Jul 7, 2020
    Posts:
    3
    Thank you! At this moment dialog box not show up but its freeze anyway (now its look freeze less than before)

    Screen:
    https://prnt.sc/20u0pz0 (i just try to add float)

    Maybe its because of unity... i have power CPU (i7 10gen) and GPU, dont know why its happen.
     
  2. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    506
    Hmm it's weird, never seen this before. Do you have error in the console? and do you have a lot of assets?
     
  3. gomotimius

    gomotimius

    Joined:
    Jul 7, 2020
    Posts:
    3
    No errors, project quite simple
    In this project few assets

    Screen:
    https://prnt.sc/20u30xa

    In this case i just pressed - apply
    Screen: https://prnt.sc/20u3hhx (sorry for phone pic, freeze again)

    Console:
    Screen: https://prnt.sc/20u3kjy

    Looks like crazy, every action hit so hard

    UPD
    Change version to 2020.3.23 (not help).
     

    Attached Files:

  4. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    506
    Can you try only uNode with empty project?
    Or can you use 'Profiler' to see what's causing the lag/freeze.
    In my machine it work with 2019.4, 2020.3, and 2021.1 and doesn't take much of RAM.
     
  5. Nikita500

    Nikita500

    Joined:
    Aug 18, 2015
    Posts:
    62
    i have the same issue without unode. its something in unity i guess. in 2021 memory high but it resets sometimes. but this version buggy so i stopped on 2019. but profile maybe im wrong
     
    vx4 likes this.
  6. vx4

    vx4

    Joined:
    Dec 11, 2012
    Posts:
    179
    Is there way to use OnDrawGizmos and OnDrawGizmosSelected in uNodeRuntime graph(run in editor).
     
  7. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    506
    Hmm look weird since i don't have such a problem, if you can please use Memory Profiler and use 'Take Sample Editor' and send the result here.
    something like this:
    upload_2021-11-27_11-36-51.png

    -Open uNodeRuntime.cs and add this code bellow into that script:
    Code (CSharp):
    1.  
    2.        void OnDrawGizmos() {
    3.            var func = GetFunction("OnDrawGizmos");
    4.            if(func != null) {
    5.                if(runtimeBehaviour != null) {
    6.                    //Invoke for native c# script.
    7.                    runtimeBehaviour.InvokeFunction("OnDrawGizmos", null);
    8.                    return;
    9.                }
    10.                //Invoke for reflection or in editor.
    11.                func.Invoke(null);
    12.            }
    13.        }
    14.  
    15.        void OnDrawGizmosSelected() {
    16.            var func = GetFunction("OnDrawGizmosSelected");
    17.            if(func != null) {
    18.                if(runtimeBehaviour != null) {
    19.                    //Invoke for native c# script.
    20.                    runtimeBehaviour.InvokeFunction("OnDrawGizmosSelected", null);
    21.                    return;
    22.                }
    23.                //Invoke for reflection or in editor.
    24.                func.Invoke(null);
    25.            }
    26.        }
    27.  
     
    Last edited: Nov 27, 2021
    vx4 likes this.
  8. vx4

    vx4

    Joined:
    Dec 11, 2012
    Posts:
    179
    i have tried and does not work for me.
    s1 .jpg
     
  9. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    506
    Are you sure the graph is uNodeRuntime or maybe you hide the uNodeRuntime gizmos?
    The code only work for uNodeRuntime graph, Class Component graph doesn't work with this.
     
  10. vx4

    vx4

    Joined:
    Dec 11, 2012
    Posts:
    179
    i have tried and it work now, there were a bug in current unity version i have(2021.2.4f1). if you try to assignee color gizmos will not draw at all.for example.

    in this case Gizmo will not draw:
    Code (CSharp):
    1.     public Color c;
    2.  
    3.  
    4.     public void OnDrawGizmos()
    5.     {
    6.         Gizmos.color = c;
    7.         Gizmos.DrawWireSphere(transform.position, 1f);
    8.  
    9.     }
    or
    bug1.jpg


    but if you don't change color will work:
    Code (CSharp):
    1.     public Color c;
    2.  
    3.  
    4.     public void OnDrawGizmos()
    5.     {
    6.         Gizmos.DrawWireSphere(transform.position, 1f);
    7.  
    8.     }
    bug2.jpg


    thx for your support.
     
  11. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    506
    I think it is because the color is transparent, try to change to change the color alpha value. It should work.
     
    vx4 likes this.
  12. vx4

    vx4

    Joined:
    Dec 11, 2012
    Posts:
    179
    :cool:
    thx, definitely you are right.
     
  13. Nikita500

    Nikita500

    Joined:
    Aug 18, 2015
    Posts:
    62
    got that memory overload even on 2019 ver too. memory gather over time during hour or more. tried to use profiler but it hang unity. so Wahid cant do anything with this info )
     
  14. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    506
    I think i found the problem, it is because of Texture2D. But still don't know where it come from, i still investigate it.

    upload_2021-12-2_1-11-11.png
    upload_2021-12-2_1-11-32.png
     
    Mark_01, AthrunVLokiz and Nikita500 like this.
  15. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    506
    After investigating, i found that it was the uNode Logo icon that take so much of memory. I don't know why the icon is loaded many time as i only load it once using the script but i think it is loaded when drawing Gizmos, Asset Icon, Hierarchy Icon, etc.
    Then after i resize the icon size to 128x128 pixels the icon now only load 128kb in memory ( 34.5 MB before ).

    Download and import the attached file to fix memory leak. If your memory usage is still too high after an hours or so, you can use menu 'Tools>uNode>Advanced>Reload Scripts' to free up some space in memory.
     

    Attached Files:

  16. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    vx4 likes this.
  17. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    506
    Do you mean when the next update or the roadmap?
     
  18. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    Yes, something like that.
    (Simply put, is there any hope that uNode will still be supported in a year or two?)
     
    Last edited: Jan 10, 2022
    vx4 likes this.
  19. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    506
    Sure uNode still regularly updated, though the new version is in BETA and it is only available for tester in uNode discord.
    New version have a lot of improvement and fixes, currently i still updating the documentation for preparing release the stable version. If you want to test a new version you can join our discord server here: https://discord.gg/8ufevvN and don't forget to DM me to access tester channel.

    And here is the roadmap: https://trello.com/b/mlANnBPw/unode
     
    Tanner555, frbrz, BebopTune and 4 others like this.
  20. DrVanillaCookie

    DrVanillaCookie

    Joined:
    Aug 23, 2021
    Posts:
    39
    Does uNode supports new input system? Like On Input System Event nodes in Bolt.
     
  21. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    506
    Currently uNode doesn't have a event for the new Input System ( it will be added ASAP) but you can getting input dirrectly from the new Input System : https://docs.unity3d.com/Packages/c...l#getting-input-directly-from-an-input-device
    -You can parse the example code with C# Parse to test it.

    And getting input indirrectly is only supported for c# graphs. This also can be tested by parsing example c# script from the Input System documentation page.
     
    frbrz, Mark_01, Stexe and 1 other person like this.
  22. frbrz

    frbrz

    Joined:
    May 10, 2016
    Posts:
    76
    COOL. uNode is amazing.
     
    Szaruga and vx4 like this.
  23. unity_0JCf0BEYAnGSnw

    unity_0JCf0BEYAnGSnw

    Joined:
    Feb 7, 2020
    Posts:
    10
    That's great! Thank you, I imported package, hope its work!

    And i can't solve one puzzle with spine! I need Flip image but its looks like no possible with unode (only if i do it manually in generated script).

    i need this one:

    [SerializeField]
    private SkeletonMecanim _skeletonMec;
    _skeletonMec.skeleton.FlipX = _flipPlayer;

    but unodes only gives me this:
    upload_2022-2-1_18-43-12.png
     
  24. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    506
    I think your graph is correct.

    if you need this:
    'private SkeletonMecanim _skeletonMec;'
    Then you just need to create a new variable and make modifier to public for show the variable in inspector.
    Or if you need the variable to private then add a 'SerializeField' in the attribute of the variable.

    Here is my simple test graph ( tested and work ) :
    upload_2022-2-2_20-48-5.png
    I don't found a SkeletonMechaim type in my project so use SpriteRenderer instead.
     
  25. unity_0JCf0BEYAnGSnw

    unity_0JCf0BEYAnGSnw

    Joined:
    Feb 7, 2020
    Posts:
    10
    Sorry for my describe. I know how to make [SerializeField].

    off-topic: for me was not so oblivious how to make array =)
    upload_2022-2-2_14-22-57.png




    The problem here:
    _skeletonMec.skeleton.flipX = _flipPlayer; /// what graphs gives me

    And i need:
    _skeletonMec.skeleton.FlipX = _flipPlayer; ///F - uppercase

    Thats why i cant use graph with SPINE. Because in SPINE should be FlipX
     
    Last edited: Feb 2, 2022
  26. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    506
    Sorry for late answer.

    I just tested the Spline, it look like the `FlipX` is Obsolete:
    upload_2022-2-10_15-14-10.png
    You can use the `ScaleX` instead or if you want to use the FlipX then enable the `Show Obsolete Item` in uNode preferences:
    upload_2022-2-10_15-17-19.png
     
  27. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    506
    uNode v2.1 has been released.

    New Smart Connections:
    The smart connections feature help you for connecting nodes more fasters without needing for re-connect the ports.


    New Unity Visual Scripting graph converter:
    This feature will help anyone who want to migrate UVS graph to uNode


    New documentation site: http://docs.maxygames.com/unode/

    New Horizontal graph layout:
    upload_2022-2-11_15-15-44.png

    And there's a lot more improvement and bug fixes, below is the full changelog.

    Changelog v2.1:
    - Optimized State Graph code generation which will run more faster and has zero allocation after initialization.
    - Now uNodeRuntime graph can execute OnDrawGizmos and OnDrawGizmosSelected when added to Game Object in the scene.
    - Added UVS Parser add-ons: use to convert Unity Visual Scripting graphs into uNode graphs.
    - Added smart connection features: hold 'shift' while moving nodes to use it.
    - Added support for dragging port into Stackable node for creating block from a value port.
    - Added new horizontal graph layout.
    - Added Compilation Method for Runtime Graphs:
    - Unity: will save the generated script in 'Assets/uNode.Generated' folder and compiled natively with Unity.
    - Roslyn: will save the generated script in temporary folder and compiled using Roslyn Compiler,
    - Advantage:
    - Runtime Graphs can be generated & compiled in background.
    - Doesn't make Unity to Reload Domain each time c# scripts is generated.
    - Seamlessly integration with Fast Enter Play Mode.
    - Provides fast generation and compilation.​
    - Disadvantage:
    - Cannot debug with other IDE like Visual Studio for example.​
    - Added 'Add Node (Favorites)' menu for adding new nodes from favorites.
    - Added support for the new Input System.
    - Added First Item node
    - Added Last Item node
    - Added Count Items node
    - Added On Button Input event
    - Added On Keyboard Input event
    - Added On Button Click event
    - Added On Input Field Value Changed event
    - Added On Input Field End Edit event
    - Added On Dropdown Value Changed event
    - Added On Toggle Value Changed event
    - Added On Scrollbar Value Changed event
    - Added On Scroll Rect Value Changed event
    - Added On Slider Value Changed event
    - Added On Pointer Click event
    - Added On Pointer Down event
    - Added On Pointer Enter event
    - Added On Pointer Exit event
    - Added On Pointer Move event
    - Added On Pointer Up event
    - Updated Odin Serialized to latest version.
    - Updated Roslyn plugin to version 4.0.1
    - Improved Code Generation: major refactoring, and optimizations.
    - Improved Graph Event System
    - Improved CSharpParser
    - Improved Editor
    - Fixed most of reported bugs

    Download here : http://maxygames.com/download/

    The new update required Unity 2019.4 or newer.

    Upgrade Note:
    Make a backup and follow the upgrade instruction on : http://docs.maxygames.com/unode/manual/installing.html#updating-unode
    If you're not follow the upgrade instruction, your graph will be broken.
     
    Last edited: Feb 11, 2022
    Nikita500, Szaruga, Stexe and 3 others like this.
  28. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    Cool! :rolleyes:
    What version of Unity is recommended to work with the latest version of uNode?
    (Because the required minimum version and the recommended version are two different issues.)
     
    Last edited: Feb 11, 2022
  29. vx4

    vx4

    Joined:
    Dec 11, 2012
    Posts:
    179
    The new update required Unity 2019.4 or newer.
     
    Stexe likes this.
  30. SwiftIllusion

    SwiftIllusion

    Joined:
    Jan 22, 2012
    Posts:
    66
    If stability is your focus, because uNode's interface is built off the Unity editor, 2019LTS is also the recommended version as it's the most stable Unity version. I've seen various issues in 2020/2021 because of Unity that users have had to hope for Unity to resolve, live with them, or downgrade.
     
    Szaruga likes this.
  31. Szaruga

    Szaruga

    Joined:
    Jan 29, 2016
    Posts:
    403
    Ok, it's logical what you write. Thank you. However - last year I was working in the configuration: uNode + Unity 2020.3.x and I had no major problems. Unity 2020 has some features that the 2019 version does not have - so I'll try to keep working with Unity 2020.
     
    SwiftIllusion likes this.
  32. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    506
    I recommend to use LTS version of Unity.
    uNode is tested on all LTS version and i had not found major problem with it.
     
    Szaruga likes this.
  33. clagrens

    clagrens

    Joined:
    May 19, 2017
    Posts:
    96
    Hi, I just change bolt to uNode on my project.
    How to Trigger custom event?
    And I found the website document is out of date.
    Lack of new node descriptions(etc:Event hook)
     
  34. Nikita500

    Nikita500

    Joined:
    Aug 18, 2015
    Posts:
    62
    many of us from other visual script assets and we started with them. so we dont understand- do like in c#/ we need pictures) or gifs/on unode documentation no about events too)

    btw maybe you can make event in bolt and convert to unode and watch how it parse it/ but im not sure this works
     
    Last edited: Apr 8, 2022
    vx4 likes this.
  35. vx4

    vx4

    Joined:
    Dec 11, 2012
    Posts:
    179
    You can try this if you are able to upgrade your project to from Bolt to unity visual scripting,
    Add following namespace to your script: Unity.VisualScripting
    Just click in any empty space in Unode Editor and will show up in inspect windows on the right where you can add it (search does not work for me just scroll down and you will find it)

    namespace.jpg

    next you can use CustomEvent.Trigger node to tigger custom event.

    custome triggger.jpg
     
    Nikita500 likes this.
  36. Nikita500

    Nikita500

    Joined:
    Aug 18, 2015
    Posts:
    62

    Attached Files:

    Last edited: Apr 8, 2022
  37. vx4

    vx4

    Joined:
    Dec 11, 2012
    Posts:
    179
    Nikita500 likes this.
  38. Nikita500

    Nikita500

    Joined:
    Aug 18, 2015
    Posts:
    62
    one more option for event. 1screen object sender (runtime). object reciever (class component)
    2screen ivoke function with data

    with scripts work like get component ( get script on object) and invoke function in it 3 screen

    screen4 if send from class component to class component it need first store gameobject in variable or find in script and i add maxygames. unode to see unodespawner component in add node menu

    screen5 as i understand it works only with c# class - create monobehavior . then variable UnityEvent -compile to script . and when put script on object it will be options to choose object and invoke its functions

    dont know will be it problems with build then. cos this all works so easy. no listeners delegates lambdas etc
     

    Attached Files:

    Last edited: Apr 17, 2022
  39. vx4

    vx4

    Joined:
    Dec 11, 2012
    Posts:
    179
    i dont recommende this way,becasue the methods you are using is not meant to used like that, also always to try Unity API in first place if you can then go to other option.
    One note,the GameObject.sendMsg does not work with Runtime Graphs.currentlly you can use it with C# Graphs only.
     
    Last edited: May 3, 2022
  40. Nikita500

    Nikita500

    Joined:
    Aug 18, 2015
    Posts:
    62
    and how to use them properly? hm people dont recommend use send message

    https://answers.unity.com/questions/982211/is-sendmessage-or-getcomponent-faster.html#:~:text=SendMessage is absurdly much slower,and calls the method directly.
    SendMessage is absurdly much slower.

    SendMessage has to go through every script, look for a method with the same name using string comparrison (slower), and call it. The GetComponent finds the script through type comparrison (faster), and calls the method directly.

    never use SendMessage, it's horrible.


     
    Last edited: May 3, 2022
  41. vx4

    vx4

    Joined:
    Dec 11, 2012
    Posts:
    179
    i am assuming, there will initial overhead only then for second time will not be that much.Is much like coroutines.Also you dont need consider performance unlese you have performance issue.
    Regards how to use it properly, is a good practice is always to try use game engine API, and if does not work for try use .NET next you you maybe use 3d party API get job done.
     
    Nikita500 likes this.
  42. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    506
    uNode v2.1.1 has been released.

    changelog v2.1.1:
    - Added double click to maximize uNode Editor window ( only for docked window )
    - Improved C# Parser
    - Improved Code Generation
    - Improved Editor
    - Fixed some of reported bugs.

    Download here : http://maxygames.com/download/
     
  43. dongliang

    dongliang

    Joined:
    May 31, 2013
    Posts:
    1
    When async await can be supported
     
  44. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    506
    It will be supported on uNode v3 but there's no ETA yet.
     
    NaoYuYan, DavidLe360 and HeadClot88 like this.
  45. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    506
    uNode v2.1.3 has been released.

    changelog:
    v2.1.3:
    - Added support for parsing async, await syntax
    - Fixed some of reported bugs.

    v2.1.2:
    - Added async, await support for c# graphs
    - Fixed some of reported bugs.

    Download here : http://maxygames.com/download/
     
    Nikita500, Stexe and vx4 like this.
  46. At09em

    At09em

    Joined:
    Mar 25, 2021
    Posts:
    5
    In Unity Visual Scripting there are ‘Application Variables’ is there something similar in uNode?

    I tries in version 2.1.3 I tried creating C# Script -> Class and I added ‘Score’ variable with with modifiers set to Public and Static.

    I need to see the value for ‘Score’ after score was increase in game. How do I see the ‘Score’ variable the inspector?
     

    Attached Files:

  47. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    506
    Yes, it's the Singleton Graph with Persistence on ( It's also show variable value during playmode ):
    upload_2023-1-7_17-42-32.png

    But you can also use C# Class Graph and use static variable modifier ( need to compile before use ).

    Accessing Singleton variable or C# Graph static variable is like accessing c# static variable.
     
  48. Nikita500

    Nikita500

    Joined:
    Aug 18, 2015
    Posts:
    62
    you need compile it to script and then add it to object in inspector and you will see them

    thats workflow for c#class you edit in unode and then compile to script

    second screen - for 2 other modes runtime and graph :variables seen in editor too
     

    Attached Files:

    Last edited: Jan 8, 2023
  49. Sarono

    Sarono

    Joined:
    Apr 12, 2018
    Posts:
    8
    hello, does uNode support ref return?

    example code:
    Code (CSharp):
    1.         ref int GetRef(ref int i)
    2.         {
    3.             return ref i;
    4.         }
    5.  
    6.         void Foo()
    7.         {
    8.             int a = 1;
    9.             ref var result = ref GetRef(ref a);
    10.         }
     
  50. wahid_rachmawan

    wahid_rachmawan

    Joined:
    Oct 4, 2017
    Posts:
    506
    Sorry, uNode doesn't currently support ref return.
     
    vx4 likes this.