- Joined
- Sep 16, 2012
- Messages
- 5,781
- Reaction score
- 1,041
- First Language
- English
- Primarily Uses
I'm sure we've all had the problem of putting BGM into our games and meticulously timing them to match certain events on the screen that are set to autoplay. However, our efforts are ruined if a player clicks out of the game as the BGM continues to play, thereby mismatching the timing with whatever is happening on screen. Basically, everything goes out of sync.
I vaguely remember there being a 'pause bgm' script or fix, but I cannot remember for the life of me where I saw this, or whether I'm just imagining it. Google isn't much help either, as searches cannot look into files such as restaff - where I have a gut feeling it might be.
Therefore, is there a 'pause bgm when the game window is defocused' script, or am I imagining it? If there isn't one at all, can one be made?
Thanks very much!
Note: For the solution marked as 'best answer' your music files have to be .ogg!
I vaguely remember there being a 'pause bgm' script or fix, but I cannot remember for the life of me where I saw this, or whether I'm just imagining it. Google isn't much help either, as searches cannot look into files such as restaff - where I have a gut feeling it might be.
Therefore, is there a 'pause bgm when the game window is defocused' script, or am I imagining it? If there isn't one at all, can one be made?
Thanks very much!
Note: For the solution marked as 'best answer' your music files have to be .ogg!
Last edited by a moderator:
