01
Inheritance and extension
- Equipment base
Equip / unequip · sockets
- Weapon base
Shared weapon entry
- Firearm base
Ammo · muzzle · abilities
- Concrete gun
Extend unique behavior
AEquipmentBase owns equip/unequip, sockets and animation layers; AWeaponBase forms the weapon branch, and AFirearm adds ammo, muzzle and ability configuration. A subclass extends only its own behavior. For example, the Disintegration Gun adds its release effect after a shot while the same manager still handles equipment switching.
02
Equipment presentation and item data
Switchable equipment- Character configures InitialEquipmentClasses
- Spawn AEquipmentBase actors
- Switch / hold / holster
Backpack items- Character configures InitialInventoryItems
- Record item class and quantity
- HasItem permission check
The character configures InitialEquipmentClasses and InitialInventoryItems separately. The first holds AEquipmentBase subclasses: the equipment manager spawns actors and handles switching, holding and holstering. The second stores item classes and quantities without spawning held equipment actors. Access cards use the item path, take no weapon slot, and are checked by doors through HasItem.
03
Firearms and projectiles
- Firearm
Ammo · muzzle · BulletClass
- Shared firing ability
Launch current projectile
- Projectile
Movement · collision · impact
- Target
Own response
AFirearm holds ammo, fire interval, muzzle and BulletClass; GA_Shoot fires, while ABulletBase owns movement, collision and the hit entry point. A projectile extends the impact behavior. For example, the Explosion Gun reuses the shared firing path while its projectile handles attachment, delayed detonation and area damage.
05
Granting and removing equipment abilities
The player ASC lives on PlayerState and persists across character switches. Equipment stores ability handles and a weak reference to the granting ASC when it grants primary fire, secondary fire, and reload. Unequip removes those abilities by handle and uses the saved ASC reference if the character can no longer provide one.
- 01
Capture ownership on grant
When equipment grants primary fire, secondary fire, and reload abilities, retain each ability handle and a weak reference to the granting ASC.
- 02
Unequip before destruction
EquipmentManager calls Unequip on the current item during EndPlay before destroying the inventory. If the character no longer supplies an ASC, removal falls back to the saved reference.
- 03
Remove by handle & reset
Remove the abilities granted by that item, cancelling secondary fire before clearing it. Reset the handles and cached ASC so the next equip starts a fresh grant cycle.
Design choices & limits
Keep the ASC persistent on PlayerState while each item manages the abilities it grants. Adding an EndPlay unequip call alone was insufficient because the character could already have lost its PlayerState; removal therefore needs the original grant reference. A weak reference does not extend ASC lifetime and is checked before use.