So i have 2 blueprints 1 is for primary and second is for secondary weapon so now im not sure if i want to add more weapons should i make actor blueprint for every specific weapon or every primary to store in one primary actor and same for secondary also weapons will have attachments
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.
1 Like