cocos_add_mouse_joint2d
Add a mouse joint to physics bodies in Cocos Creator scenes, enabling interactive drag-and-drop functionality for game objects.
Instructions
Attach cc.MouseJoint2D — drag-to-target constraint, used to pick up bodies with the mouse.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"scene_path": "<scene_path>",
"node_id": "<node_id>"
},
"name": "cocos_add_mouse_joint2d"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scene_path | Yes | ||
| node_id | Yes | ||
| max_force | No | ||
| frequency | No | ||
| damping_ratio | No | ||
| target_x | No | ||
| target_y | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |