FlowInput.isConnected is always false when play on device

Forums ๐Ÿ’ฌ FlowCanvas โš™๏ธ Support FlowInput.isConnected is always false when play on device

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #21686
    toto007
    Participant

      I need known to runtime when an flowInput is connected to a node. So I use the variable Port.isConnected. It’s works play editor but when I play on my device android it’s always false:

      So I tried to call GetFirstInputConnection() instead of IsConnected and it works in version build runtime and version editor runtime

      Although I found the workaround I was wondering if I was proceeding towards the right way.

      #21691
      Gavalakis
      Keymaster

        Hello again,

        Sorry for the late reply.
        Port.isConnected currently only works in editor. This is done so for performance reasons since Port.isConnected is set correctly within a part of the code that is a bit performance heavy and not really needed in runtime.
        With that said, I will make isConnected work correctly in runtime as well for consistency in the next version.
        Using GetFirstInputConnection() != null is definetely a solution to that which I might just use as well ๐Ÿ™‚

        Thanks!

        #21690
        madaboutpandas
        Participant

          We also stumbled upon this issue during development. We would very much appreciate to have this feature available at runtime.

          #21689
          Gavalakis
          Keymaster

            Thank you for your input and confirmation that this is needed.

            I have added this to the roadmap. It’s a bit harder to implement than I thought perfomance wise, cinsidering the current implementation, but it will happen ๐Ÿ™‚

            Thank you.

            #21688
            toto007
            Participant

              [quote quote=2265]Thank you for your input and confirmation that this is needed. I have added this to the roadmap. Itโ€™s a bit harder to implement than I thought perfomance wise, cinsidering the current implementation, but it will happen ย Thank you. [/quote]

              I would not like to ask a question with a too complex answer but I would like to know the reasons why it could lead to a deterioration in performance.

              I ask this question because I’m modifying your framework quite intensively for my use case and I wouldn’t want it to make any mistakes that I shouldn’t be making

              #21687
              Gavalakis
              Keymaster

                Hey,

                It’s just that the way isConnected is determined in the editor, is after calling the FlowNode.GatherPorts -> ValidateConnections.
                ValidateConnections is currently wrapped in a #if UNITY_EDITOR, because the way validations are made a performance costly (lots of foreach iterations and type conversion checks), which are otherwise not really required in runtime. Unfortunately or not, isConnected is set from within this Validation method.

                So, if we were to simply remove #if UNITY_EDITOR and run ValidateConnections method, while isConnected will work correctly, there will be a performance cost.

                Thus, the solution would be to find another way to determine isConnected and move it outside of the Validate methods, which requires some refactoring to make sure everything works as intended.

                ๐Ÿ™‚

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