RunService:IsRunning() returns false for plugins on startup

Reproduction Steps
RunService:IsRunning() returns false for plugins during runtime on the first frame.

Create a plugin with the following code:

print("IsRunning", game:GetService("RunService"):IsRunning())
task.wait()
print("IsRunning", game:GetService("RunService"):IsRunning())

Save the code as a plugin, and then run the game.

Expected Behavior
If running the game, the script should output “IsRunning true” twice in a row.

Actual Behavior
If running the game, the script shows “IsRunning false” and then “IsRunning true”, which demonstrates that either IsRunning doesn’t work on the first frame, or perhaps there’s some sort of race condition.

Workaround
As shown in the script, arbitrarily yielding for a frame seems to fix the problem. However, this is not ideal.

Issue Area: Studio
Issue Type: Other
Impact: Low
Frequency: Constantly
Date First Experienced: 2022-02-10 00:02:00 (-05:00)
Date Last Experienced: 2022-02-10 00:02:00 (-05:00)

16 Likes

Try waiting longer, maybe you didn’t do it in the split second.

It’s a bug that there is any timing consideration at all. The expected behavior is that it works on the very first frame, hence the bug report.

9 Likes

Hi @sleitnick, Thanks for reporting the issue. We’ll investigate and fix it ASAP. We aim at getting it released in the week of 2/21!

4 Likes

This issue should be fixed now! Can you confirm it? @sleitnick

2 Likes