i’ve been trying to optimize my game, but theres this one issue that i cant seem to find the cause of.
the game seems to suffer a small but very noticeable lagspike when certain things happen;
equipping/unequipping a tool (it only happens on some tools with models)
teleporting (my game has a teleport system, im pretty sure the lag comes from the orb part that appears when you teleport)
tweening (every tween in the game is only for one client, i havent tested if it somehow lags the server though. some tweens lag the game while others dont, the one that lags the most is a tween of multiple neon orbs, it lags every frame for that one)
the lagspikes happen on the server and affects other clients
i looked on the microprofiler and there seemed to be 2 things causing lagspikes, i cant trace any of them back to any scripts so i dont know what to do)
i genuinly dont know what do to, this is my first time using the microprofiler and optimizing this heavily, so any help would be greatly appreciated
You mention orbs a lot, maybe you have a common orb you use in many of these issues, that happens to be composed of many triangles? Have you thought of simplifying that orb object?
Troubleshoot by removing and replacing the orbs with a simpler part like the post above me is talking about, and for the tool try removing the model temporarily and observing any changes in data. If the tweens are done on the client and if nothing from your scripts are influencing the lag spikes I would probably bet it has something to do with the orbs or models.
i was answering this but i then found out that if i removed the biggest area in my game the lagspikes disappear. im not sure what exactly in the area is making the lagspikes happen, but it has ALOT of parts so ill do some experimenting
update on this, its not the area i was talking about it was a subarea within that area that was causing the lagspikes, still gonna have to find what in that area is causing it though