2.7 KiB
2.7 KiB
| name | description | metadata | ||
|---|---|---|---|---|
| inputsystem-controlscheme-add | Add a Control Scheme (with optional required / optional device requirements) to a `.inputactions` asset, then save it. |
|
InputSystem / Add Control Scheme
Add an InputControlScheme to an InputActionAsset. A control scheme groups bindings by a set of devices (e.g. a 'Keyboard&Mouse' scheme and a 'Gamepad' scheme), letting the same Actions support multiple input setups.
Inputs
assetPath— required. Path to the existing.inputactionsasset.schemeName— required. Unique control-scheme name.requiredDevices— optional device control paths that MUST be present (e.g.<Gamepad>).optionalDevices— optional device control paths that MAY be present (e.g.<Mouse>).
Behavior
Loads the asset, adds the control scheme via AddControlScheme, registers each required / optional device requirement, saves and re-imports the asset. Runs on the Unity main thread.
How to Call
unity-mcp-cli run-tool inputsystem-controlscheme-add --input '{
"assetPath": "string_value",
"schemeName": "string_value",
"requiredDevices": [],
"optionalDevices": []
}'
For complex input (multi-line strings, code), save the JSON to a file and use:
unity-mcp-cli run-tool inputsystem-controlscheme-add --input-file args.jsonOr pipe via stdin (recommended):
unity-mcp-cli run-tool inputsystem-controlscheme-add --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 |
|---|---|---|---|
assetPath |
string |
Yes | 'Assets/'-rooted path to the existing '.inputactions' asset. |
schemeName |
string |
Yes | Unique name of the new control scheme. |
requiredDevices |
array |
No | Optional required device control paths (e.g. ''). All must be present for the scheme to be usable. |
optionalDevices |
array |
No | Optional optional-device control paths (e.g. ''). |
Input JSON Schema
{
"type": "object",
"properties": {
"assetPath": {
"type": "string"
},
"schemeName": {
"type": "string"
},
"requiredDevices": {
"type": "array",
"items": {
"type": "string"
}
},
"optionalDevices": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"assetPath",
"schemeName"
]
}
Output
This tool does not return structured output.