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.
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 |