Reply To: Custom Node with 3 outputs

Forums 💬 NodeCanvas 🗨️ General Discussion Custom Node with 3 outputs Reply To: Custom Node with 3 outputs

#14995
Gavalakis
Keymaster

    Hey,

    The OnPortConnected and OnPortDisconnected indexes are the indexes of the nodes that were just connected or disconnected, but since nodes are resorted in editor based on their relative position to the parent, you can’t rely on that index.

    The correct indexes to rely to would be that of the outConnections property, which is what is used to execute the child nodes if you you take a look at any existing node.

    So in ‘OnExeute’ of the node, outConnections[0] will be the first connection, outConnections[1] the 2nd and so on.

    But I wonder, why would you want such a node. I mean you could use a Selector and 3 child nodes decorated with an Accessor. So based on the condition of the Accessor execute either of the child nodes of the Selector.

    Unless I misundertood something 🙂

    Let me know