How can I get AnimationNode that is connected to an AnimationNodeOutput

Ah, right. I didn’t test it and the documentation wasn’t clear :sweat_smile:

It’s possible to get the connections but it’s not exposed directly.

extends Node


@onready var animation_tree: AnimationTree = $AnimationTree


func _ready() -> void:
	var tree = animation_tree.tree_root as AnimationNodeBlendTree
	var connections = tree.get("node_connections")
	for i in range(0, connections.size(), 3):
		var target = connections[i + 0]
		var input_idx = connections[i + 1]
		var source = connections[i + 2]
		print("Node %s is connected to %s in port %s" % [source, target, input_idx])
1 Like