A number of things:
- You should probably be overriding
IsNodeSafeToIgnoreto return true. The alternative (when nodes aren’t ignored) is a much more complicated implementation. - You should also be overriding
ExpandNodeto callBreakAllNodeLinks. Ultimately this function will be what replaces your node with the other nodes that aren’t ignored. - The second parameter to CreatePin shouldn’t be created manually. You should be using the constants from the
UEdGraphSchema_K2scope. - There is no PinCategory of type “then”. The output pin should also use the
UEdGraphSchema_K2::PC_Execcategory just as the input pin does. - While you can specify the name of the pin as the third parameter (and most of the time you have to), you should use the ones provided by the schema (
UEdGraphSchema_K2::PN_Execute&UEdGraphSchema_K2::PN_Then) for the primary execution pins (if/when your node requires them). There’s built in logic to the blueprint graph that is designed to work with those specific names and if you don’t use them, your node won’t always work in the graph the same as similar nodes. - Unless you have a very specific reason, calling
Super::should come first and not last (as you do inAllocateDefaultPins). The exceptions here are where the function is part of a shutdown process likeEndPlayin which case theSuper::call should come last, but this is really relevant to K2Nodes.