I’m making a third person game that has 14 weapons in total, each with 1-4 attachments that have gameplay effects and show up on the weapon itself (scopes, extended mags etc)
The player can carry any number of weapons in their inventory if there’s space. When a weapon is unequipped it can either go on the back or the hip. (Think RE4 style inventory and system).
So at any point, there can be 1-3 spawned weapon actors on the character (one equipped and two unequipped).
Right now I’m spawning and destroying weapon actors when they are equipped/unequipped. But I’m thinking that an object pool would probably be a better solution because the player can hotkey up to 4 items. So swapping weapons with the hotkeys is essentially performing one destroy and 2 spawn operations every time (one to destroy the equipped weapon, one to spawn the same weapon but unequipped in the right slot, and one to spawn the new weapon).
I’m wondering if I should just keep all picked-up or in-inventory weapon actors spawned all the time? And just move, attach and make them visible instead of spawning or destroying them?