My game is very small but still lags down to about 20fps when the character walks. The game has afew models and about 15 scripts, I am using RenderStepped on my local scripts to try and avoid lag. The map is already so small and I am woried that when the game expands it will be unplayable even on top end devices.
Can anyone give my a tip on how I can reduce the lag. I can’t link the game as the project is supposed to be going secret. I would love to hear advice from people that have dealt with this in the past.
The building in your map more than likely isn’t causing the issue since there’s not a lot there, so it definitely shouldn’t be memory intensive.
I’d recommend looking through your scripts since, to me, only the scripts could be causing the issue. You could move each script over to another place individually for you to test them, which might help you identify what’s causing the issues more efficiently. That’s all I can suggest because I’m not a scripter.
To the best of my knowledge, loops (particularly while loops) and memory intensive processes can cause issues with performance. There’s likely other causes which arise from scripts alone but, as I said, I’m not a scripter.
Thus us hyst tge test game but in this place there are gates you can interact with, currently one npc that just walks around a little area and a zone you can go in that displays a gui.
I can’t share a link as I don’t want ot reveal too much of the game
You should only be using renderstepped for functions relating to the players character or camera. (All code in your renderstepped functions have to run before the next frame will be rendered, causing huge performance issues.)
Heartbeat should be used for everything else.
If you’re binding slow code to renderstepped - that’s a red flag as it has to run that code before the scene renders. Try switching to Heartbeat and get back to me - happy new years!