Welcome! Definitely lots of ways to ramp up your skills. There’s not really enough info for me to offer much for your problem. It sounds like (from the description of your problem) there might be a lifetime issue with your audio sources, perhaps they are staying around when they shouldn’t, or something like that.
If you want to try and track down what’s happening yourself, I recommend liberally sprinkling Debug.Log() statements through your code to display information in realtime.
Doing this should help you answer these types of questions:
- is this code even running? which parts are running? how often does it run? what order does it run in?
- what are the values of the variables involved? Are they initialized? Are the values reasonable?
Knowing this information will help you reason about the behavior you are seeing.
You can also put in Debug.Break() to pause the Editor when certain interesting pieces of code run, and then study the scene, such as to see if your music source is there, or if it is not playing, etc.
You could also just display various important quantities in UI Text elements to watch them change as you play the game.
If you are running a mobile device you can also view the console output. Google for how on your particular mobile target.
Here’s an example of putting in a laser-focused Debug.Log() and how that can save you a TON of time wallowing around speculating what might be going wrong:
https://discussions.unity.com/t/839300/3
ALSO… These are some great tutorials to start with, just huge firehoses of amazing info, and before long if you put in the effort you will impress yourself with how much you know.
Imphenzia / imphenzia - super-basic Unity tutorial:
https://www.youtube.com/watch?v=pwZpJzpE2lQ
Brackeys super-basic Unity Tutorial series:
https://www.youtube.com/watch?v=IlKaB1etrik
Sebastian Lague Intro to Game Development with Unity and C#: