For some odd reason mobile players have been crashing when they join my game and its lowering my average playtime severly and I have NO idea why.
This is affecting my play count and revenue severely as I have had to shut down as mobile players where leaving dislikes due to not being able to play.
The game is a tycoon but there is only 1 set of purchases that only load in when you buy a tycoon so it cant be the models loading in. So thus I have no idea. Any help is greatly appricated.
This just begun after I updated and I have tried changing multiple scripts to no avail. I have also enabled streaming enabled and disabled multiple scripts to see what could be causing it but I have no idea.
After doing some searching around apparently this is on roblox’s end. But why would roblox be causing a 2 second frame? The frames after it caused by me are only around the 1 second range and then slowly going down to 15ms from there…
Opening the Developer Console (F9) and checking the memory should give you an insight into what’s using the most memory. I’ve got the feeling it’s using way too much memory for phones to be able to handle.
Without any scripts, it’s hard to debug the issue. However, I can recommend to use Streaming Enabled, which will significantly reduce lag on lower end devices.
Using @ReturnedTrue 's method to check for memory leakage is also a good idea, especially if the problem happens over time.
I’ve looked into the console and memory seems fine to me. A thing to mention is that this isn’t a direct crash but rather an incredibly long lag spike. Only 2 of these happen right after eachother.
You can join the game but a few frames after you joined an lag spike happens, once that is over another few frames pass by and another lag spike happens. The rest of the game runs pretty smoothly with no such lag spikes. Now I’ve noticed that these spikes also happens on PC but alot less noticeable (max 2s). Compared to mobile with took about 20 seconds.
Using the mircoprofiler I’ve also found 2 frames which took incredibly long to complete. I’ve tried searching which scripts caused this but to be honest, I have no idea how to exactly use the microprofiler.
Regarding streaming enabled. It completely skipped my head. We’ll try enabling it and see if helps. Thank you guys for the replies so far!
Do you have anything that you’d perhaps say resource heavy that runs straight away in a LocalScript?
If so, try making it procedural by integrating intervals into it.
With your code, we can help you much more than suggesting broad solutions. If you don’t want to give you’re code, that’s fine, but then we can’t help you very well.
If it’s a problem with your code: The above solutions won’t help much.
We don’t know either; Unless you give us scripts. That’s the barrier here.
If you are trying to figure them out, you can go through and disable the scripts one by one until the issue gets better. That’s the easiest option as of now.
Things that can cause issues like this can include for loops with large amounts of things to iterate through (usually with GetChildren or GetDescendants), a lot of instances being spawned at once (this is not limited to BaseParts), a lot of CFrames being set at once (including SetPrimaryPartCFrame), or just long threads of code in general. One thing that used to cause a similar problem in one of my games was actually part of the player initialization stage, where a ton of values and folders were cloned into the player when loading, not to mention the massive amounts of objects spawned to represent inventories.