Node Attachment Rule Customization
Sometimes, you may want to add some restrictions or special behaviors when attaching nodes to each other in Joint's graph editor. This can be achieved by customizing the node attachment rules.
For C++ (Runtime Node Class)
To customize node attachment rules in C++, you can use the following two functions in your custom node class that inherits UJointNodeBase:
virtual const FJointEdPinConnectionResponse CanAttachThisAtParentNode_Implementation(const UObject* InParentNode) const;
virtual const FJointEdPinConnectionResponse CanAttachSubNodeOnThis_Implementation(const UObject* InParentNode) const; 
- CanAttachThisAtParentNode_Implementation: This function is called when you try to attach the current node to a parent node. You can implement your custom logic here to determine whether the attachment is allowed or not.
- CanAttachSubNodeOnThis_Implementation: This function is called when you try to attach a sub-node to the current node. You can implement your custom logic here to determine whether the attachment is allowed or not.
Both functions should return an FJointEdPinConnectionResponse structure, which contains information about whether the attachment is allowed and any relevant messages.
You can set the response type using the EJointEdCanCreateConnectionResponse enum - and here are the available options:
UENUM(BlueprintType)
namespace EJointEdCanCreateConnectionResponse
{
	/** Make the connection; there are no issues (message string is displayed if not empty). */
	enum Type {
		CONNECT_RESPONSE_MAKE,
		/** Cannot make this connection; display the message string as an error. */
		CONNECT_RESPONSE_DISALLOW,
		/** Break all existing connections on A and make the new connection (it's exclusive); display the message string as a warning/notice. */
		CONNECT_RESPONSE_BREAK_OTHERS_A,
		/** Break all existing connections on B and make the new connection (it's exclusive); display the message string as a warning/notice. */
		CONNECT_RESPONSE_BREAK_OTHERS_B,
		/** Break all existing connections on A and B, and make the new connection (it's exclusive); display the message string as a warning/notice. */
		CONNECT_RESPONSE_BREAK_OTHERS_AB,
		/** Make the connection via an intermediate cast node, or some other conversion node. */
		CONNECT_RESPONSE_MAKE_WITH_CONVERSION_NODE,
		/** Make the connection by promoting a lower type to a higher type. Ex: Connecting a Float -> Double, float should become a double */
		CONNECT_RESPONSE_MAKE_WITH_PROMOTION
	};
}
For BP
You can override CanAttachSubNodeOnThis and CanAttachThisAtParentNode to make a new attachment rule for your nodes.

See the example implementation below that forbids any nodes to be attached to the current node:

