2.8 KiB
| name | description | metadata | ||
|---|---|---|---|---|
| animator-modify | Apply a batch of modifications to a Unity `AnimatorController` — add/remove parameters, layers, states, and transitions; set default states; set state motion/speed. Use 'animator-get-data' first to discover valid names. |
|
Animator / Modify
Apply a batch of modifications to a Unity AnimatorController asset. Each modification is dispatched by its AnimatorModificationType discriminator. Use 'animator-get-data' first to discover valid names so the diff is targeted.
Inputs
animatorRef— reference to theAnimatorControllerasset (path must start withAssets/and end with.controller).modifications— array ofAnimatorModificationentries.
Supported modification types
AddParameter/RemoveParameter— manage controller parameters (float, int, bool, trigger).AddLayer/RemoveLayer— manage animator layers.AddState/RemoveState— manage states inside a specific layer.SetDefaultState— pick the default state for a layer.AddTransition/RemoveTransition— manage state-to-state transitions.AddAnyStateTransition— add a transition from Any State.SetStateMotion— assign anAnimationClipas a state's motion.SetStateSpeed— set a state's speed multiplier.
Behavior
Per-modification errors are accumulated in the response's errors array instead of aborting the whole batch. The controller asset is marked dirty and saved after the modifications complete.
How to Call
unity-mcp-cli run-tool animator-modify --input '{
"animatorRef": "string_value",
"modifications": "string_value"
}'
For complex input (multi-line strings, code), save the JSON to a file and use:
unity-mcp-cli run-tool animator-modify --input-file args.jsonOr pipe via stdin (recommended):
unity-mcp-cli run-tool animator-modify --input-file - <<'EOF' {"param": "value"} EOF
Troubleshooting
If unity-mcp-cli is not found, either install it globally (npm install -g unity-mcp-cli) or use npx unity-mcp-cli instead.
Read the /unity-initial-setup skill for detailed installation instructions.
Input
| Name | Type | Required | Description |
|---|---|---|---|
animatorRef |
string |
Yes | Reference to the AnimatorController asset to modify. RQL: AssetObjectRef |
modifications |
string |
Yes | Array of modifications to apply to the controller. RQL: [AnimatorModification] |
Input JSON Schema
{
"type": "object",
"properties": {
"animatorRef": {
"type": "string"
},
"modifications": {
"type": "string"
}
},
"required": [
"animatorRef",
"modifications"
]
}
Output
This tool does not return structured output.