Use class hierarchy…
Weapon (main weapon class - Parent)
– Assault Rifles ( child class of weapon )
– Pistols ( child class of weapon )
– Shotguns ( child class of weapon )
AK47 ( Child of Assault Rifles )
Scar-L ( Child of Assault Rifles )
M1911 ( Child of Pistols )
Berretta 92 ( Child of Pistols )
- All universal code, variables etc should be written in the Weapon class.
- Configuring the weapon should happen in the specific weapon class (ak47, m1911 etc).
- Cast to Weapon class instead of specific actor class.
- Variable references should be saved as Weapon Obj Reference.