Node with Coroutines

Forums 💬 FlowCanvas ⚙️ Support Node with Coroutines

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #21663
    madaboutpandas
    Participant

      Hi,

      I just bought your asset. Looks nice so far.
      You support coroutines in the class LatentActionNode and provided the sample WaitNode. Unfortunately this code produces memory garbage. It is 9 bytes by Unity Coroutines. Another garbage comes from the new op of the two queues. Just instantiate them earlier. It comes in unhandy when the Garbage Collector runs and causes frame drops on VR/mobile.

      Can you make a node with a possibility to delay but without coroutines? Think about async tasks or simple time math in the Update function?

      Duplicate post
      https://forum.unity.com/threads/flowcanvas-visual-scripting-similar-to-unreal-blueprints.318585/page-21#post-3985336

      Thanks

      #21665
      Gavalakis
      Keymaster

        Hello again and thanks for getting FlowCanvas! 🙂

        The allocation from the Queue instantiation can certainly be avoided (I will take care of that soon), but as for the allocation caused by the Unity StartCouroutine call, I don’t think that there is much that can be done here unfortunately :/

        Regarding making a delay without coroutines, it is possible to an extend, although not as flexible as using coroutines in the same way that LatentActionNodes do. I have attached for you here an example node called “SimpleDelay” (unitypackage), that is created without coroutines, but rather by utilizing “IUpdatable.Update” (an inteface that nodes can implement if need be).

        Please let me know if that is something that would work for you. I don’t know whether I add such node officially, but you can definetely keep it as a custom node if it does indeed work for you.

        Thanks!

        #21664
        madaboutpandas
        Participant

          Hi,

          Thanks a lot! That is what I need. We are working on this code so the node only gets an update called when it is active. We plan graphs with many many nodes. I can send you the results when it is done.

          Kind Regards,
          Chris

        Viewing 3 posts - 1 through 3 (of 3 total)
        • You must be logged in to reply to this topic.