Frictional Games Forum (read-only)

Full Version: Music Stops After Death
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So, when testing my custom story I discovered that upon death, the music I had set to play in the map would stop playing until the player leaves the map and comes back. Anyone know why this might be? I have it set to resume, however I only have PlayMusic set inside OnEnter. Music also stops playing upon loading a saved game, but only in some maps. Any help with this problem would be greatly appreciated, and thanks in advance Smile
Put it in OnStart
Ah. Thanks Smile
Interesting that OnStart would fix, since I've always had my music in OnStart, yet if I die, it doesn't start up again and it is set to repeat/loop.
Actually I haven't died since then, so I'm not sure if it works or not. I was still trying to work out the rest of the bugs in the coding, but still managed to live every time. The odd thing is, though, it works on a map where the music starts after a certain function is called, but not on the maps where I have the music within either the OnStart or OnEnter. Also, I noticed that putting it in OnStart makes it fail to resume after leaving and coming back, so there should be a better solution.
OnEnter?
Everytime you enter.
If you have checkpoints, you could enter the PlayMusic script at the void of the checkpoint.

If you can die in a map, then you should also have some checkpoints.