Is handling animations in one modulescript worth it?

I’m currently working on reworking my combat system for an upcoming game me and a friend are creating (going to be heavily inspired by combat warriors, criminality, mortem metallum etc.) and I saw a previous devforum post where someone was asking how he could optimize his combat, and someone suggested handling all the animations on one module script in replicated storage, so I decided to try it. Previously all animations were handled in one server script and when you equipped the weapon it would check if a variable named after the specified animation was nil and if it was it would define the variable as the loaded animation (which prevents the animation from loading more than once I think)

I want to control the animations and the stamina through just one localscript using the modules, but I’m having doubts on whether or not this would be worth it? I feel like its unnecessary work when I could just get the children of the folder the animations are stored in and load them once like I did in my previous script, am I just overthinking this? I’m very sorry if this post is too confusing I honestly have no idea what I’m doing.

Modules are best used to chunk work that can be utilized by many other entities (or scripts).

So if you’re using a lot of scripts that all need to manage player animations, I think this is a good idea. Again, it all depends on the complexity of what you’re trying to do.

Another tip, each module should have its own unique task. So you could specifically make one that handles animations, and then other scripts can use it for that work directly.

All in all though, keep it simple. If you don’t see more than 1 or 2 scripts doing something regarding player animation, then a whole module dedicated for it might not be worth the work.

2 Likes

Your right, I will be adding more weapons soon once I get the combat more polished and easily configurable so it probably would be best to handle it on a module script, as I am hoping to have at least 10-15 weapons with unique mechanics and properties. Thank you for your reply.

1 Like