cocos_add_rigidbody_3d
Add physics simulation to 3D objects in Cocos Creator by attaching rigid body components with configurable mass, gravity, damping, and movement constraints.
Instructions
Attach cc.RigidBody (3D).
body_type: 1=DYNAMIC (default), 2=STATIC, 4=KINEMATIC. Values are engine's ERigidBodyType bitmask, NOT contiguous 0/1/2 like the 2D API. linear_factor / angular_factor lock motion on a per-axis basis (set component to 0 to freeze that axis, 1 for free movement).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scene_path | Yes | ||
| node_id | Yes | ||
| body_type | No | ||
| mass | No | ||
| use_gravity | No | ||
| allow_sleep | No | ||
| linear_damping | No | ||
| angular_damping | No | ||
| linear_factor_x | No | ||
| linear_factor_y | No | ||
| linear_factor_z | No | ||
| angular_factor_x | No | ||
| angular_factor_y | No | ||
| angular_factor_z | No | ||
| group | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |