cocos_add_box_collider2d
Add a 2D box collider to game objects in Cocos Creator for physics interactions, collision detection, and sensor triggers.
Instructions
Attach cc.BoxCollider2D with given size, offset, and physics material.
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_box_collider2d"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scene_path | Yes | ||
| node_id | Yes | ||
| width | No | ||
| height | No | ||
| offset_x | No | ||
| offset_y | No | ||
| density | No | ||
| friction | No | ||
| restitution | No | ||
| is_sensor | No | ||
| tag | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |