cocos_add_relative_joint2d
Attach a relative joint in Cocos Creator to maintain position and angle between physics bodies, enabling follow-target behavior for game objects.
Instructions
Attach cc.RelativeJoint2D — keeps relative position+angle ('attach to' effect).
Also covers the follow-target use case that the old cocos_add_motor_joint2d
tried to solve; cc.MotorJoint2D does not exist in Cocos 3.8.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scene_path | Yes | ||
| node_id | Yes | ||
| connected_body_id | No | ||
| max_force | No | ||
| max_torque | No | ||
| correction_factor | No | ||
| auto_calc_offset | No | ||
| linear_offset_x | No | ||
| linear_offset_y | No | ||
| angular_offset | No | ||
| collide_connected | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |