Studio "Play Solo" wait() is waiting way longer then it should


#1

This is a bizarre issue that started happening to me a few days ago. Whenever I Play Test in studio, any and all “wait()” calls of any length [wait(1), wait(.1), wait(10), etc.] delay the code CONSIDERABLY longer than they should. The length of delay seems to be variable, but in some cases I’ve had 2 wait()'s delay the script by upwards of 30 seconds.

This occurs every time I try to play the game in test mode. I have tried restarting / reinstalling Roblox Studios. However, it seems to only occur in a few places - for me [https://www.roblox.com/games/1609536135/Escape-Room-DEMO] most noticeably. Also, the actual live / Roblox Client versions of the game experience no improper lag or timing issues.

I’m not sure what can be done to help resolve this, but it certainly is a strange behavior that is rather annoying when trying to develop a game. I’m going to keep messing around with Studio to try and see if I can find an actual cause for this [i.e. if it’s something I’m doing or a bug with the specific place, etc.]


#2

I’ve noticed this too, this isn’t the only problem I’ve had though, e.g. the escape menu no longer works in Play Solo and also this LoadCharacterAppearance breaks SetCore


#3

Turn off “Respect Studio shortcuts when game has focus” to fix the esc issue.


#4

This isn’t anything new, the more you call wait() the longer each wait() takes. How often are you calling it?


#5

Make sure DefaultWaitTime is 0.03. To debug wait calls print what’s returned by it: the elapsed time and game’s run time.

> print(wait())
0.039767084541381 4889.0698920087

Also check the Task Scheduler and Performance tools on Studio.


#6

I’m not using wait() calls all that much [or at least no more so than in other games without the issue].
And I’ll check that out - thanks @FieryEvent

EDIT:

Wow. printing wait() shows this, which is probably the problem.
image

but LuaSettings have the correct DefaultWaitTime
image


#7

Any thread could prevent the one you’re calling wait from resuming, we cannot know which one from what you posted.


#8

the MicroProfiler may be able to help figure out what is going on:
http://robloxdev.com/articles/MicroProfiler