node.isConnected – usage in build?

Forums 💬 FlowCanvas ⚙️ Support node.isConnected – usage in build?

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #22050
    soulburner
    Participant

      I’ve spent lots of time trying to figure out why my project works differently when being built.

      And finally found that I was using “.isConnected” in the code and it returns false when the project is run not in editor.

      Digging further found this:

      Seems that this part causes the problem.

      So, is it a bug or am I not supposed to use isConnected in the code?

      #22056
      Gavalakis
      Keymaster

        Hello,

        The isConnected property is not really supposed to be used in runtime code, but I could change the code so that it can be used.
        What is your use case if I may ask?

        Thanks!

        #22055
        soulburner
        Participant

          Sorry, for the late reply. We’re having Orthodox Christmas holidays here in Russia 😉

          I’m using it to return a specific value if the input is left not connected:

          Or maybe that’s not the right way to do it?

          #22054
          soulburner
          Participant

            PS: I can’t use comparation to null because, NodeCanvas puts “Self” in the input if it is not connected. Also, I don’t want to disable that “self” feature because I’m using it sometimes…

            #22053
            Gavalakis
            Keymaster

              Hello again and happy new year!

              Is that code part of a custom node?
              If so, is the reason you are doing these checks, to avoid linking up variable nodes in the graph to avoid redundancy?
              In either case, I can see that .isConnected can be useful in certain cases 🙂 As such I will fix this so that it work in runtime for the next version, but until that next version, you can indeed remove the #if UNITY_EDITOR define from “ValidateConnections” and as such have it work as it was working before.

              Thank you!

              #22052
              soulburner
              Participant

                Hi there!

                Basically, I need to know if the input of the node is really empty. Even if it can be converted to GameObject and the nodecanvas code will auto-fill it with the “self” value. I don’t need that “auto-fill with self” feature in this particular case.

                #22051
                Gavalakis
                Keymaster

                  Hey!
                  Thanks for the follow up.
                  Got it! 🙂 I will make sure that .isConnected works as expected from the next version and on! 🙂

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