- Home /
Hundreds of weapons, best practice
I am working on a 2D game in which the player will eventually have hundreds of different weapons in their inventory to choose from. My player is a character rigged puppet and my thought is to dynamically add any given weapon to the right hand GameObject of the puppet.
I am not sure the best way to tackle this as far as optimization goes.
Here are the 3 options I am currently toying with:
Create an instance of any selected weapon prefab and load it to the hand at run time.. maybe too slow at run time?
Add all weapons to the hand via the hierarchy at design time, disable all of them and just enable the selection at run time... I figured this might waste RAM for weapons that may not even get selected.
Get all prefabs, or their string paths, on start up and load into array to access at run time. Although this seems similar to option 2.
Any suggestions on a good approach for such a scenario? Please share!
Your answer
Follow this Question
Related Questions
Improving script performance 1 Answer
Prefab with UI.Text is not unloaded 1 Answer
About Model Combine Optimization? 1 Answer
Huge prefab file sizes 0 Answers