I am trying to rework my gun system right now however, I am worried about the huge amount of attributes I’m currently using for each tool.
Here’s the deal, I do not like to use modules to store my gun stats, so instead I use attributes. My gun system is complex and each gun can have about 20 attributes, all of them being stuff like stats and useful values.
Here is an example:
Also keep in mind I have optimized the system to avoid getting attributes too much (Hard to explain but what I am trying to say is that I am not getting attributes everytime a gun shoots.
The simple question is, can too many attributes be a problem in terms of performance/reliability?
I personally don’t believe there’d be any issue with having a bunch of attributes but I wouldn’t take my word for it as I’ve never really used attributes.
What I will say though is that on the creator documentation it literally shows your use case as an example so I highly doubt it would pose any issues at all
Personally though I use boolValues, object values, string values, etc inside a folder under a tool for stats because I find it easier to reference and change and stuff. Thats just personal preference however and I am unsure if it offers performance benefits.
The performance impact from using multiple attributes is likely in the same range as using a ModuleScript to store attributes, meaning you should just stick to what works for you.
In your case I would probably make a ModuleScript for certain weapon stats such as the price, spread, reload time, but keep attributes for anything input related like smoothness and intensity.