add_skeleton_socket
Add or replace a socket on a skeletal mesh's skeleton, defaulting to GunBarrel on the ik_hand_gun bone. Specify bone, transform, and scale; optionally save the skeleton.
Instructions
Add or replace a socket on the USkeleton used by a skeletal mesh (e.g. GunBarrel).
Infantry uses the GunBarrel socket name with GetSocketTransform on the mesh.
Sockets are stored on the skeleton asset; Python mesh.add_socket is unreliable in UE5.6.
Defaults parent the socket to ik_hand_gun (Mannequin weapon IK bone) with a 22 cm
offset along local +X (typical muzzle direction). Override relative_rotation as
[pitch, yaw, roll] in degrees if traces fire along the wrong axis.
Args:
skeletal_mesh_path: Content path to the USkeletalMesh (e.g. /Game/.../SithSoldier).
socket_name: Socket name (default GunBarrel).
bone_name: Parent bone (default ik_hand_gun; use hand_r if your rig has no IK gun bone).
relative_location: Optional [x, y, z] in cm relative to the bone.
relative_rotation: Optional [pitch, yaw, roll] in degrees.
relative_scale: Optional [x, y, z] scale (default 1,1,1).
save: If True, persist the skeleton package via low-level SavePackage.
KB: see knowledge_base/01_BLUEPRINT_FUNDAMENTALS.md#overview Example: add_skeleton_socket(skeletal_mesh_path="/Game/MCP_Test/Example")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| save | No | ||
| bone_name | No | ik_hand_gun | |
| socket_name | No | GunBarrel | |
| relative_scale | No | ||
| relative_location | No | ||
| relative_rotation | No | ||
| skeletal_mesh_path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |