Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Capricho on Mon 02/06/2025 22:20:21

Title: Why isn't the music playing?
Post by: Capricho on Mon 02/06/2025 22:20:21
Why is the background music not playing in my game?
Please help me so I can move forward.
Thank you
function room_AfterFadeIn()
{
  aMusic.Play(eAudioPriorityVeryHigh, eRepeat);
}
Title: Re: Why isn't the music playing?
Post by: Crimson Wizard on Mon 02/06/2025 22:27:17
In the situation like this the first thing that you should check is whether the function "room_AfterFadeIn" is run at all. Place a simple display command there:

Code (ags) Select
function room_AfterFadeIn()
{
  Display("Play music!");
  aMusic.Play(eAudioPriorityVeryHigh, eRepeat);
}

If you won't see the message either, that means that your function is not connected to the room event.
https://adventuregamestudio.github.io/ags-manual/images/acintro3_05.png
Title: Re: Why isn't the music playing?
Post by: Capricho on Mon 02/06/2025 22:53:07
yes, that was the mistake.
The music is already playing  ;-D
Thank you
Beginnings are hard