After tinkering with the scripts the last few nights, I'm pretty much at “banging my head on my desk” status when it comes to proper weapon scripting. At first I made a really simple raycast weapon that transmits damage done to any object it hits (which actually only does something if the object in question has a objHealth script).
This was all well and dandy for a quick test, but for more complex weapons I need more stuff:
Additionally, some weapons utilize raycasts while other create projectiles, and those require different things. Raycasts need to know:
And projectiles need to know:
It's 8:19pm now. After a lot of thought, I've decided the best way is to cram all this stuff into one base class, and create a very nice, responsive Inspector UI for it (which I'll make later). This'll keep everything consistent, and it really shouldn't get THAT complicated. It's a basic state machine with a few public variables (some of which are straight-up ignored depending on the weapon type) and one or two public functions. So long as I keep it well commented it shouldn't be too hard to decipher what's going on either.