My game microprofile is terrible how can i fix it?

this is my game microprofile it is terrible i dont know how to fix it any help will be appreciated i have a TON of scripts and i cant look for every script and check which one is causing the lag. how can i find the one that is causing the lag??

heres the micro profile

Go to the Scripts section in the console, it should show you which scripts are using the most resources.

5 Likes

theres a script named [Unknown] should i be worried?

No, unless it’s causing a lot of lag. Make sure to check both client and server scripts.

1 Like

i have no idea man, the game is still lagging i have seen the scripts in the log that are running and they are normal the activities are not high . the game just all of a sudden lags even though the activities of the scripts are the exact same. they dont change since the start of the session its just that more scripts are being called by time and thus creating lag. i have optimized every single script removing every single while loops and switching it to getpropertychangedsignal(). but still the game is lagging i do not know what to do ?? and btw the client memory usage is HIGH like it reaches sometimes 1800 MB or even 2000 MB

It could be some virus affecting the game. Try searching for suspicious scripts you don’t know and using ctrl shift f and find keywords in all scripts such as require, math, etc

1 Like

While the microprofiler is open, press CTRL + P to pause it. Then, click on any of the orange bars to get a breakdown of what is happening each frame. You can click and drag on the main window to scroll up/down/left/right. You want to look for some wide bars, which indicate that those tasks taking up a lot of computation power. Scrolling also helps to squish/unsquish the bars.

To understand what each label does, there is some documentation here that explains the common labels: Tag Table | Documentation - Roblox Creator Hub.

If the performance issues are due to your own code, your labels may not have any names on them (or they are named ‘Unknown’). You can use debug.profilebegin() and debug.profileend() in your code to tag certain pieces of code that are ran. If your code is being ran in, for example, a Heartbeat loop, you will want to look for the area in the microprofiler’s frame breakdown where the Heartbeat loop is being ran. In my game’s case it’s this region.

image

i have never used any free models and even if i did i have deleted them all

FINALLY I HAVE FOUND THE SOLUTION ,
its the gui in my game specificly my scripts they are running even though the gui is off, so i made a script that disables all scripts when the gui is invisible.

thankfully its been working perfectly so far if anything goes wrong ill tell yall thanks for every one who helped me !

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.