What is best way of weapon inventory in multiplayer game, cache instance of weapon actor or spawn /delete weapon actor on equip /unequip?

Hi,

I am working on shooter game prototype and following idea came to my mind, please let me know if this approach is good or not?

  1. Spawn and destroy object at runtime is heavy so instead we can use instance of spawned actor.
  2. instead of using weapon pickup object separate include pickup behavior in master weapon blueprint

In lot of example I have seen weapon actor spawn and destroyed on weapon swap/switching method, please suggest me performant way of weapon inventory implementation.

It depends on your game, personally I set the visibility of the actor to false when it is not in character’s hands (set visibility is replicated by default), but I do not think there is a miracle answer, it will really depend on the needs and the game, even if I agree, spawning a new actor at each swap/switching of item seems a bit overkill to me

1 Like