Configure a Firearm and Reload It
Give the player two game weapons with different controls. The rifle keeps firing while the button is held and reloads a magazine. The shotgun fires once per press and reloads one shell on each animation loop.
Register a firearm and supply reserve ammo
Create a
NinjaCombatWeaponActorBlueprint with a weapon mesh and aNinjaCombatFirearmComponent. Add a muzzle socket to the mesh and return that mesh fromGetProjectileSourceMeshon the ranged interface. Give each weapon an identifying tag. Register it and map its attachment socket as in the weapon setup. Test one equipped firearm at a time.Create a Firearm Definition from the Ninja Combat menu and assign it to the component. Set the muzzle socket and a hitscan channel that reaches the test target. Assign the firearm damage effect and set a positive Base Pellet Damage if each hit should reduce health. Assign shooting and reloading montages on the component. Add an Ammo Storage Component to the character and give it starting reserve ammo whose tags match the definition's ammo query.
Setting | Rifle example | Shotgun example |
|---|---|---|
Implementation and fire mode | Hit Scan, Automatic | Hit Scan, Single Shot |
Pellets per shot | One | Several, with spread so the traces can separate |
Ammo Limit and Initial Ammo | 30 | 8 |
Reload Mode | Clip | Single, with Ammo Added set to 1 |
Reload montage | A Reload section with one Reload Ammo notify | Reload, Loop, and End sections. Put Reload Ammo in Loop and match the loop and end names in the definition. |
Connect fire and reload
Grant abilities based on
CombatAbility_ShootandCombatAbility_Reload. Use their firearm Shoot and Reload animation providers. Match the shooting section name in the ability to the montage and set the reload section to Reload. Set the reload policy to Gameplay Event and its weapon query to match the active firearm.From the fire input call
TryOpenFireon press andTryCeaseFireon release on the active Firearm Component. The component requests the Shoot ability. Activate the granted Reload ability from the reload action.

For camera or AI aiming, implement GetAimIntent on the controller's Combat Aim Intent Provider Interface. For a custom reserve, implement GetAvailableAmmo and TakeAmmo on the ammo storage interface. To show different effects on wood and stone, use a Combat Impact Cosmetics table with entries for the surfaces and assign it to the firearm. See Combat and Inventory for equipment and reserve items.
Try It in Play
Fire three rifle rounds, release, then reload. Check that the loaded count increases at the notify and the reserve falls by the same amount. With the shotgun, hold fire once and check for one shot. Reload from several shells down and watch each loop add one until capacity or reserve runs out.