FlowInput.isConnected is always false when play on device

FlowCanvas Forums Support FlowInput.isConnected is always false when play on device

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2162
    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.

    #2163
    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!

    Join us on Discord: https://discord.gg/97q2Rjh

    #2264
    madaboutpandas
    Participant

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

    #2265
    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.

    Join us on Discord: https://discord.gg/97q2Rjh

    #2266
    toto007
    Participant

    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.

    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

    #2268
    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.

    ๐Ÿ™‚

    Join us on Discord: https://discord.gg/97q2Rjh

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