add_physics_asset_constraint
Add a ragdoll constraint (joint) between two bones in a physics asset, defining child/parent and a limited swing+twist cone. Idempotent by name; snaps joint frames when both bones exist.
Instructions
Author a ragdoll constraint (joint) inside a UPhysicsAsset between two bones. Creates a UPhysicsConstraintTemplate via FPhysicsAssetUtils::CreateNewConstraint (idempotent by name — re-using a name returns the existing joint), sets the child/parent bones and a Limited swing+twist cone, and snaps the joint frames to the bones' default relative transform when BOTH bones exist in the preview-mesh skeleton (skipped honestly otherwise, since the engine fatal-checks an unknown bone). Refine motions/limits afterwards with set_physics_asset_constraint_limits.
Returns: { physics_asset_path: string, constraint_name: string, constraint_index: int, child_bone: string, parent_bone: string, already_existed: bool, child_in_skeleton: bool, parent_in_skeleton: bool, child_body_index: int, parent_body_index: int, frames_snapped: bool, collision_disabled: bool, constraint_count: int, saved: bool, save_error?: string, note?: string, constraint: object }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| child_bone | Yes | Name of the child bone/body (ConstraintBone1, the moving end). | |
| parent_bone | Yes | Name of the parent bone/body (ConstraintBone2, the anchor end). | |
| constraint_name | No | Optional joint name (defaults to child_bone); re-using an existing name is idempotent (no duplicate). | |
| physics_asset_path | Yes | /Game path to the UPhysicsAsset to add the constraint to. |