My game contains quite a lot of parts and scripts and is rather laggy on lower-end devices, and I was wondering what the best ways of reducing this are.
I’ve tried removing unneeded lines of code and grouping everything in the Workspace, but this has has little to no effect.
I’ve got about 20 scripts, with 2 heavy ones running on the client. These 2 scripts most likely aren’t the most efficient, as they are fired whenever a part is touched.
It’s not the number of scripts, it’s what those scripts are doing. You can have 1000 scripts that do a very simple job and have no impact or 1 script that is flawed that crashes the whole game.
Look into using the microprofiler and identifying which operations are taking all the processing time. Identify if your “lag” is on the client or the server too.