I’m working on a weapon system and trying to decide between two approaches for performance:
Approach 1: Centralized with task.spawn()
- One script manages all weapons
- Each weapon’s simulation runs in task.spawn()
- Up to ~30 weapons could be active simultaneously
Approach 2: Individual LocalScripts
- Each weapon tool has its own LocalScript
- Natural distribution across script instances
My main question: Does task.spawn() provide enough performance isolation for heavy computational tasks (ballistics, recoil simulation, etc.), or do individual LocalScripts distribute load better?
Specifically wondering:
- Do task.spawn() threads truly run concurrently or just cooperatively?
- With 30 weapons doing frame-based calculations, which approach would perform better?
Thank you!