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) and, ideally, a few poses of the character holding it.
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.
1. Add the slot¶
Open /GASPALS/Systems/EquipmentSystem/Data/Enum_Equipment and click Add Enumerator. Name it Shotgun. Save.
The equipment menu builds its buttons from this enum, so the new slot shows up in the menu by itself.
2. Prepare the mesh sockets¶
Open the item mesh (for a skeletal mesh, its skeleton) and add:
| Socket | Where |
|---|---|
HandIK | Where the support hand grips (the shotgun's pump). The hand's palm lines up with the socket. |
ADS | The sight point: on the sight line, at the rear sight. Only for items you aim down sights with. |
Copy the transforms from the rifle (/GASPALS/Systems/EquipmentSystem/Assets/Meshes/M4A1_Skeleton) as a start.
3. Create the item actor¶
Duplicate /GASPALS/Systems/EquipmentSystem/Actors/BP_Equipment_Rifle and rename it BP_Equipment_Shotgun. Select its mesh component and set your mesh (for a static mesh, delete the skeletal mesh component and add a Static Mesh component instead).
Keep exactly one mesh component and keep the AC_FirstPersonRendering component: it creates the first-person copy of the mesh at runtime, and the equipment system only attaches and updates hand IK for items that have it. Do not add a first-person duplicate mesh or rendering tags.
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), or add overlay_shotgun to every skeleton your characters use:
| Skeleton | Bone for a right-hand item |
|---|---|
SK_UEFN_Mannequin (the pawns) | weapon_r |
SK_Mannequin (Manny, Quinn) | hand_r |
metahuman_base_skel (Kellan) | hand_r |
Copy the overlay_rifle socket and adjust it with Add Preview Asset (right-click the socket) showing the shotgun mesh, while the skeleton preview plays a rifle pose.
5. Create the overlay poses¶
Third person¶
- Duplicate
/GASPALS/Systems/OverlaySystem/OverlayPose/Rifle/ABP_Overlay_Rifleinto a new folderOverlayPose/Shotgunand name itABP_Overlay_Shotgun. - Open its Class Defaults. Under GASPALS > Overlay > Poses, each pose is an animation plus a curve map:
Stand_Relax_Idle,Stand_Ready_Idle,Stand_Aim_Idle(and the Walk, Run, Sprint and Crouch variants). Set your shotgun poses (single-frame animations are enough). Start with the rifle poses if you have none yet. - Keep the curve maps of the rifle: they decide which body parts the pose takes over and turn 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.
- Check Can Aim, and the Aim Sweep Interp Speed Local / Remote values (30 / 10).
See Add an overlay state for the full list of poses and curves.
First person (optional)¶
Duplicate /GASPALS/Systems/OverlaySystem/FirstPerson/Rifle/ABP_OverlayFirstPerson_Rifle into ABP_OverlayFirstPerson_Shotgun and set its first-person poses. Without one, first person shows the third-person overlay.
6. Create the data asset¶
Right-click in Data/ > Miscellaneous > Data Asset > pick PDA_Equipment (or duplicate DA_Equipment_Rifle). Name it DA_Equipment_Shotgun and fill it:
| Field | Value |
|---|---|
| Spawned Actor | BP_Equipment_Shotgun |
| Overlay Pose TP | ABP_Overlay_Shotgun |
| Overlay Pose FP | ABP_OverlayFirstPerson_Shotgun (or empty) |
| Attach Socket TP / FP | overlay_shotgun (or overlay_rifle) |
| Attach Offset TP / 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). |
7. Add the chooser row¶
Open Data/CHT_Equipment. Add a row: in the Enum_Equipment column pick Shotgun, and as the result pick DA_Equipment_Shotgun. Save.
8. Test¶
- Play, hold T, select Shotgun, 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. - Switch to first person (1 until first person) and aim: the sights should line up with the screen center. Fix the
ADSsocket if not. - Press M to try the retargeted characters, and N for the other pawn.
- Run a listen server with a client and equip the shotgun on the client.
Variations¶
- No actor (an overlay without an item, like hands tied): leave Spawned Actor empty and set only the overlay poses.
- Left-handed item: turn on Is Left Handed and attach to a left-hand socket (
overlay_torchstyle). - Start with the item: set Selected Equipment on the pawn's
AC_EquipmentSystemcomponent.