Add an equipment item¶
This tutorial adds a shotgun. The same steps work for any held item: a weapon, a tool, a carried object. You need:
- the item's mesh (skeletal or static);
- ideally, a few poses of the character holding it, as animations on the UEFN mannequin skeleton (
/GASPALS/Characters/UEFN_Mannequin/Meshes/SK_UEFN_Mannequin), the skeleton the overlay Anim Blueprints use. Single-frame animations are enough. Until you have them, the rifle's poses work as placeholders.
The result: the shotgun appears in the equipment menu, attaches to the hand, switches the character to your poses in third and first person, and places the support hand with IK.
Background: Equipment system, Overlay system.
All equipment assets are in /GASPALS/Systems/EquipmentSystem; the paths below are relative to it unless they start with /GASPALS.
1. Add the slot¶
Open Data/Enum_Equipment, click Add Enumerator and set the new enumerator's Display Name to Shotgun. Save.
The equipment menu builds its buttons from this enum (labeled with the display name), so the new slot shows up in the menu by itself, at the end of the list. To place it elsewhere, drag its row by the handle on its left; the menu follows the enum order. Slots listed in the component's Hidden Equipment are left out (the revolver is, by default).
2. Prepare the mesh sockets¶
Add these sockets to the item mesh: for a skeletal mesh, on its Skeleton (open the skeleton, right-click a bone > Add Socket); for a static mesh, in the Static Mesh Editor's Socket Manager.
| Socket | Where |
|---|---|
HandIK | Where the support hand grips (the shotgun's pump). The support hand is placed on this socket, position and rotation. |
ADS | The sight point: on the sight line, at the rear sight. Only for items you aim down sights with. |
Use the rifle's sockets as a starting point: they are on the root bone of Assets/Meshes/M4A1_Skeleton. If your mesh already has sockets with other names, keep them and set Hand IKSocket / ADSSocket in the data asset (step 6).
3. Create the item actor¶
Duplicate an existing item actor in Actors/ and rename it BP_Equipment_Shotgun:
- for a skeletal mesh, duplicate
BP_Equipment_Rifle; - for a static mesh, duplicate
BP_Equipment_Torch(orBP_Equipment_Box).
Open it, select its mesh component (SkeletalMesh or StaticMesh) and set your mesh. The item must not collide (it could push the character or block the camera): on a static mesh, keep Collision Presets on NoCollision (the torch's setting); on a skeletal mesh, use no physics asset or set the same preset.
The actor only needs its mesh component. Do not add a first-person component, a first-person duplicate mesh or rendering tags: the pawn's first-person system creates the first-person copy of the mesh at runtime. To show the item in third person only, turn Create First Person Copy off in its data asset (step 6).
Tip
Add extra parts (a flashlight, a strap) as more mesh components. Each gets its own first-person copy. Tag a component DoNotAttach if it should stay where it is instead of being attached to the hand socket.
4. Add the attach socket on the character skeletons¶
The item attaches to a socket on the character's Skeleton. Either reuse overlay_rifle (a long gun held in the right hand; nothing to do), or add overlay_shotgun to every skeleton your characters use:
| Skeleton | Bone for a right-hand item |
|---|---|
/GASPALS/Characters/UEFN_Mannequin/Meshes/SK_UEFN_Mannequin (the pawns) | weapon_r |
/GASPALS/Characters/UE5_Mannequins/Meshes/SK_Mannequin (Manny, Quinn) | hand_r |
/GASPALS/MetaHumans/Common/Female/Medium/NormalWeight/Body/metahuman_base_skel (Kellan) | hand_r |
On each skeleton, start from the overlay_rifle values (select the socket and copy its Relative Location and Relative Rotation, then add overlay_shotgun on the same bone and paste them). To adjust it, right-click the socket > Add Preview Asset, pick the shotgun mesh, and preview a holding pose (a Pose_Rifle_* animation or yours).
A skeleton without the socket attaches the item at the character's feet.
5. Create the overlay poses¶
Third person¶
- Duplicate
/GASPALS/Systems/OverlaySystem/OverlayPose/Rifle/ABP_Overlay_Rifle, rename itABP_Overlay_Shotgunand move it to a new folder,OverlaySystem/OverlayPose/Shotgun. - Open it and go to Class Defaults. Under Overlay > Poses > Stand and Overlay > Poses > Crouch, each pose (
Stand_Relax_Idle,Stand_Ready_Idle,Stand_Aim_Idle, the Walk, Run and Sprint variants, and the crouch Idle and Move variants) has an Overlay Pose (the animation) and a Curve Map. Set your shotgun animations; keep the rifle's where you have none yet. - Keep the rifle's curve maps: they decide which body parts the pose takes over, and
enable_handik_lturns the support-hand IK on. - Set Stand Aim Sweep and Crouch Aim Sweep if you have aim sweep animations (arms aiming up and down); otherwise keep the rifle's.
- Under Overlay > General, keep Can Aim on (an item you aim with); under Overlay > Aim, keep Aim Sweep Interp Speed Local / Remote at 0 / 10 (a local value of 0 follows the aim without interpolation, which avoids visible stepping).
See Add an overlay state for the poses and curves in detail.
First person (optional)¶
Duplicate /GASPALS/Systems/OverlaySystem/FirstPerson/Rifle/ABP_OverlayFirstPerson_Rifle, rename it ABP_OverlayFirstPerson_Shotgun and set its first-person poses, keeping the rifle's curve maps (see Give an item first-person poses). Without one, first person shows the third-person overlay; the first-person curves (enable_cr_fp_ads for aiming down sights, among others) come from the first-person overlay, so give an item you aim with one.
6. Create the data asset¶
Duplicate Data/DA_Equipment_Rifle and rename it DA_Equipment_Shotgun (or right-click in Data/ > Miscellaneous > Data Asset and pick PDA_Equipment). Fill it:
| Field | Value |
|---|---|
| Spawned Actor | BP_Equipment_Shotgun. Required: without an actor, the item's overlay poses are not used. |
| Overlay Pose TP | ABP_Overlay_Shotgun |
| Overlay Pose FP | ABP_OverlayFirstPerson_Shotgun (or empty) |
| Attach Socket TP / Attach Socket FP | overlay_shotgun (or overlay_rifle) |
| Attach Offset TP / Attach Offset FP | Small corrections; the rifle uses a -5 degree yaw on TP. |
| Is Left Handed | Off (on for items held in the left hand, like the bow). |
| Hand IKSocket / ADSSocket | HandIK / ADS (the defaults), or your mesh's socket names. |
| ADSEnter Speed / ADSExit Speed / ADSHand Offset | First-person aim down sights: keep 15 / 5 / (0, 0, 0) to start. |
| Create First Person Copy | On (the default): the item shows in the first-person hands. Off: third person only. |
| First Person Motion Profile | DA_FPMotion_Rifle, DA_FPMotion_Pistol, DA_FPMotion_Bow or DA_FPMotion_Heavy (in /GASPALS/Systems/FirstPersonSystem/Motion), or empty for the pawn's default (Tune first-person motion). |
7. Add the chooser row¶
Open Data/CHT_Equipment and add a row: in its enum column pick Shotgun, and as its result pick DA_Equipment_Shotgun. Save.
Without a row, the slot falls back to DA_Equipment_Unequip: selecting it leaves the hands empty.
8. Optional: ragdoll get-up¶
The CMC pawn's ragdoll picks its get-up animation from the hands that hold the item, which AC_EquipmentSystem gives per slot. A new slot answers "no hands" (the default get-up) until you add it:
- Open
AC_EquipmentSystemand the functionGetHeldItemHands. - The Switch on Enum_Equipment node now has a Shotgun pin. Connect it to a new Return Node with Left Hand and Right Hand set like the most similar item (copy the Rifle's return node).
- Compile and save.
9. Test¶
- Save all, then play. Hold T and scroll up once (from Unequip the highlight wraps to the end of the list) to highlight Shotgun, then release.
- Check the grip in third person: idle, walk, run, sprint, crouch, aim (Right Button). If the item is offset, fix the skeleton socket (step 4) or Attach Offset TP. If the support hand misses, move the item's
HandIKsocket. If nothing appears in the hands, check the chooser row (step 7) and Spawned Actor (step 6). - Switch to first person (press 1 until you reach it) and aim: the sights should line up with the screen center. Fix the
ADSsocket if not. - Press M to try the retargeted characters (each uses its own skeleton's socket), and N for the other pawn.
- Run a listen server with a client (Try multiplayer), equip the shotgun on the client and check it in both windows.
Variations¶
- Pose without an item (hands tied, an injured arm): use an overlay stance instead (Add an overlay state). An equipment data asset without Spawned Actor behaves like Unequip: the overlay system's stance shows, not the data asset's poses.
- Left-handed item: turn on Is Left Handed, attach to a socket on the left hand (
weapon_lon the UEFN mannequin,hand_lon the others, likeoverlay_bow), and turn onenable_handik_rinstead ofenable_handik_lin the poses' curve maps so the right hand is the support hand. - Start with the item: set Selected Equipment (Equipment > Selection) on the
AC_EquipmentSystemcomponent of both pawns,SandboxCharacter_MoverandSandboxCharacter_CMC(or of your own pawn). - Hide an unfinished item: add its slot to Hidden Equipment (Equipment > UI on
AC_EquipmentSystem): in the class defaults, and on the component of each pawn, whose value can differ. The menu leaves it out and scrolling skips it;SelectNewEquipmentstill equips it. Remove it from the list to show it again.