I’m starting to work on implementing guns into my game, and I’m not quite sure how I should approach it, but I came up with the following idea:
From a menu in a seperate scene, the player can choose their build (1 Melee and 1 Gun), this build is then saved to disk
When loading into a game, a script attaches the selected melee and gun prefabs to the player GameObject from a folder, each gun has its own behaviour script
Is there anything here I should pay close attention to? Anything I’m missing?
But keep it simple and work in small testable steps, because essentially your long chain of ideas above is actually conflating an inventory system (what gun you can equip) and a save game system (what gun you have equipped) as well as load system (instantiate the correct gun, correctly on the player), not to mention the actual gunplay itself.
ALL of this stuff can be found in tutorials.
Two steps to tutorials and / or example code:
do them perfectly, to the letter (zero typos, including punctuation and capitalization)
stop and understand each step to understand what is going on.
If you go past anything that you don’t understand, then you’re just mimicking what you saw without actually learning, essentially wasting your own time. It’s only two steps. Don’t skip either step.