Roblox game crashes for mobile users?

If you’re dealing with less than ~150 objects this probably isn’t the issue, but otherwise I like to wait one frame every 30 or so iterations. By using the index of a for loop you can use this logic to wait once every 30 instances:

if i%30 == 0 then
    wait()
end

Of course you can wait less than this, but waiting once every 100 would probably be a good upper bound.

Well I am cloning 6 tycoon each with over 100 buttons so this may be the case. Should I just clone the 6 tycoons in studio?

If this happens every time a player joins, I guess you could just put a wait() between every time a tycoon spawns.

Well 6 of the tycoons spawn when a server is created.

I took a look around in the micro-profiler and found this? What exactly does this mean? (I have never used the micro-profiler before.)

I looked around and found that apparently its something on roblox’s end, then why did it just start lagging now. They average run about 300ms during the spike which crashes most users. The whole thing lasts 2 seconds for 1 frame.

Does not seem to work I put a wait(2) in between each tycoons creation and it still causes this massive lag spike. When looking into other games their lag spike at the beggining when you load in is about 300ms… why is mine 2000?

Just a quick post, for those who may stumble upon this post and have the same problem.

Make sure you are not using lots of wait()s as this can drag what would be a 2 or 3 second wait up to 20 or 30 seconds on lower end devices.

In my case I was using over 350 total wait()s in my code.

If your not sure what to change your wait()s into there is a great post here which can help you.

Does it mean that not using “wait()” a lot but use like “wait(1)” or “wait(2” please explain more I have trouble from this and my player count dropping

Using wait as a whole is bad, use any wait replacement or use the new task.wait()!