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