AnimationNodeDefinition

Summary

Inherited Members
Code Samples
Connect Clips to a Blend Node
local HttpService = game:GetService("HttpService")
local WALK_ANIMATION_ID = "rbxassetid://2510202577"
local RUN_ANIMATION_ID = "rbxassetid://2510198475"
local graph = Instance.new("AnimationGraphDefinition")
graph.Name = "WalkRunGraph"
local function createNode(name: string, nodeType: Enum.AnimationNodeType): AnimationNodeDefinition
local node = Instance.new("AnimationNodeDefinition")
node.Name = name
node.NodeId = HttpService:GenerateGUID(false)
-- Set the type first, since changing it resets the input pin list
node.NodeType = nodeType
node.Parent = graph
return node
end
local function connect(inputNode: AnimationNodeDefinition, pinName: string, sourceNode: AnimationNodeDefinition): ObjectValue
local connection = Instance.new("ObjectValue")
connection.Name = pinName
connection.Value = sourceNode
connection.Parent = inputNode
return connection
end
local output = createNode("GraphOutput", Enum.AnimationNodeType.GraphOutput)
local blend = createNode("Blend1D", Enum.AnimationNodeType.Blend1DNode)
local walk = createNode("Walk", Enum.AnimationNodeType.ClipNode)
local run = createNode("Run", Enum.AnimationNodeType.ClipNode)
walk:SetAttribute("AnimationId", WALK_ANIMATION_ID)
run:SetAttribute("AnimationId", RUN_ANIMATION_ID)
-- Halfway between the walk input at 0 and the run input at 1
blend:SetAttribute("Position", 0.5)
-- GraphOutput already has a "Pose" pin
connect(output, "Pose", blend)
-- Blend1D starts with no pins, so register one for each connection
connect(blend, "Walk", walk):SetAttribute("Position", 0)
blend:AddInputPin("Walk")
connect(blend, "Run", run):SetAttribute("Position", 1)
blend:AddInputPin("Run")
print(blend:GetOrderedInputPinNames()) -- {"Walk", "Run"}
graph.Parent = workspace

API Reference
Properties
NodeId
Read Parallel
Capabilities: Animation
AnimationNodeDefinition.NodeId:string

NodeType
Read Parallel
Capabilities: Animation
AnimationNodeDefinition.NodeType:Enum.AnimationNodeType

Methods
AddInputPin
Capabilities: Animation
AnimationNodeDefinition:AddInputPin(pin:string):()
Parameters
pin:string
Returns
()
Code Samples
Connect Clips to a Blend Node
local HttpService = game:GetService("HttpService")
local WALK_ANIMATION_ID = "rbxassetid://2510202577"
local RUN_ANIMATION_ID = "rbxassetid://2510198475"
local graph = Instance.new("AnimationGraphDefinition")
graph.Name = "WalkRunGraph"
local function createNode(name: string, nodeType: Enum.AnimationNodeType): AnimationNodeDefinition
local node = Instance.new("AnimationNodeDefinition")
node.Name = name
node.NodeId = HttpService:GenerateGUID(false)
-- Set the type first, since changing it resets the input pin list
node.NodeType = nodeType
node.Parent = graph
return node
end
local function connect(inputNode: AnimationNodeDefinition, pinName: string, sourceNode: AnimationNodeDefinition): ObjectValue
local connection = Instance.new("ObjectValue")
connection.Name = pinName
connection.Value = sourceNode
connection.Parent = inputNode
return connection
end
local output = createNode("GraphOutput", Enum.AnimationNodeType.GraphOutput)
local blend = createNode("Blend1D", Enum.AnimationNodeType.Blend1DNode)
local walk = createNode("Walk", Enum.AnimationNodeType.ClipNode)
local run = createNode("Run", Enum.AnimationNodeType.ClipNode)
walk:SetAttribute("AnimationId", WALK_ANIMATION_ID)
run:SetAttribute("AnimationId", RUN_ANIMATION_ID)
-- Halfway between the walk input at 0 and the run input at 1
blend:SetAttribute("Position", 0.5)
-- GraphOutput already has a "Pose" pin
connect(output, "Pose", blend)
-- Blend1D starts with no pins, so register one for each connection
connect(blend, "Walk", walk):SetAttribute("Position", 0)
blend:AddInputPin("Walk")
connect(blend, "Run", run):SetAttribute("Position", 1)
blend:AddInputPin("Run")
print(blend:GetOrderedInputPinNames()) -- {"Walk", "Run"}
graph.Parent = workspace

GetOrderedInputPinNames
Capabilities: Animation
AnimationNodeDefinition:GetOrderedInputPinNames():{any}
Returns

RemoveInputPin
Capabilities: Animation
AnimationNodeDefinition:RemoveInputPin(pin:string):()
Parameters
pin:string
Returns
()

SetOrderedInputPinNames
Capabilities: Animation
AnimationNodeDefinition:SetOrderedInputPinNames(pins:{any}):()
Parameters
pins:{any}
Returns
()

Events
InputPinsChanged
Capabilities: Animation
AnimationNodeDefinition.InputPinsChanged():RBXScriptSignal

©2026 Roblox Corporation. Roblox, the Roblox logo and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.