Documentation

Learn how to use FlowCanvas

Download PDF Version

Generic Type Nodes

When you are to select a node to add through the “Add Node” context menu or similar menus, there are a lot of nodes that come with a (T) suffix. These nodes are generic nodes. What this means is that they can work with any relevant type you want. As such, you will not find nodes like GetTransform, or GetAnimator. Instead you will encounter nodes like GetComponent(T), which will suffice to get any component type that you so require.

GenericTypeNode

Once the generic node is added into the graph, you will notice that the generic ports are shown with a “?” (question mark) icon. This is what is called a “Wild Port”. This means that the node is still waiting for you to provide a type. This can be done in either of the two ways bellow.

  • You can simply drag and drop a connection of the type you want the node to work with, into the Wild Port.
  • Or you can right click the node and change the Wild Port type to the desired one, through the menu named “Change Generic Type”.

Here is an example for the Unity Instantiate node. Notice that once the Camera connection is made, both of the Node’s Wild Ports are turned into a Camera Type port. In practice the definition of the Instantiate node is now set to be ‘Instantiate<Camera>’.

WildPort

Now, the most important thing about these nodes, is that the type that will be listed when selecting a type through the right click context menu as available types to be selected, is directly affected by the Preferred Types editor and the types listed there. As such it is very important to tailor your Preferred Types list to your project if the default types do not suffice.

Yes No Suggest edit
9 of 9 users found this section helpful
Suggest Edit