Also, if you're using Unity, I'd recommend enabling Run In Background under Project Settings → Player → Resolution and Presentation before making a build. For this type of game, it's a much better fit since it allows the game to keep running even when it's not the active window.