cocos_add_rigidbody2d
Attach a 2D physics body to game objects in Cocos Creator to enable realistic movement, collisions, and interactions within scenes.
Instructions
Attach cc.RigidBody2D. body_type: 0=Static, 1=Kinematic, 2=Dynamic.
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_rigidbody2d"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scene_path | Yes | ||
| node_id | Yes | ||
| body_type | No | ||
| gravity_scale | No | ||
| linear_damping | No | ||
| angular_damping | No | ||
| fixed_rotation | No | ||
| bullet | No | ||
| awake_on_load | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |