- Home /
best way to weapon swapping
well this may sound like a stupid question but i am making a weapon switching system and i want to know what is the best way to do it. so far i looked and all i see is 2 ways of doing it. the first one is having all the weapon already attach to the player and enabling them one at a time depending on the weapon needed but i dont think that is what i want since there will be 100+ guns. the other way i know of is by instantiating the weapon needed as a child of the camera using an array . so i want to know if using an array is really the best way of weapon swapping or are there better ways of doing it ?
thank you for the time you took to answer my question it is very appreciated.
P.S.: please note that i am not asking for codes, all i want is an explanation on the best way to do it and why.
Wow, 100+ guns? Are they generating procedurally or there are 100 absolutely different guns with different models?
How players will swap weapons? By special menu or by scrolling mouse wheel(pressing special button)? I mean, how much time you have between two swappings?
$$anonymous$$y player will only have a maximum of 9 weapon switchebale weapon
So why don't you want to have instantiated 9 switchable weapons attached to mainCamera and enable only that you need? Use 2 arrays. One for switchable weapons and other for others. When you need to put into first array new gun just destroy old one and instantiate new. Hope my advice will help you :)
Your answer
Follow this Question
Related Questions
Weapon pick up and switching script 2 Answers
Why doesn't this weapon switching script work 1 Answer
Cycling through enum with key press 1 Answer
Weapon Switch Animations 1 Answer
Weapon swapping in-game 2 Answers