I have an action list which runs every time the player enters a certain room (all rooms are in the same scene so its really just a camera change). In the action list is Sound:Play Music node which triggers a Crossfade music track. This is useful when coming to this room from a room which plays a different music track and works well.
However when coming from a room already playing this music track, upon triggering the action list, I'd say about 30% of the time the track restarts, while 70% of the time it just continually plays through without restarting.
Seems like a bug perhaps since it doesn't always happen?
Could do with an "Ignore if already playing" check box in the Sound:Music node like there is in the Sound:Play node.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
I shall investigate - what are your AC and Unity version numbers?
Are you queueing or looping the tracks in question?
Unity version 2018.3.6f1
AC version v1.66.7
Looping yes, queueing no.
What if you play them without crossfading?
I cannot recreate any such problem. A check is already in place to prevent a track from restarting if it is already in place. In this scenario, the codeblock in Soundtrack.cs will be executed:
Try inserting the following before it, to help debug what's going on:
Separately, duplicate the project and upgrade to the latest AC release - does it occur in that as well for you?
I don't want to be upgrading AC mid project, incase I mess up something on the old one. I have a work around so will do that. I'll replay to this thread when I'm into my next project when I will upgrade AC and let you know if the issue is still there.