Recommended way to have Dialogue System handle music?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
ilike2d
Posts: 4
Joined: Mon Jan 22, 2018 2:14 am

Recommended way to have Dialogue System handle music?

Post by ilike2d »

Hi, I have a somewhat vague question but was hoping for some pointers/general advice... I want to have particular conversations in my game change the music that is playing at the time, and then sometimes change the music in the middle of the conversation. I was wondering if there is a preferred way to do something like this with Dialogue System? Thank you!
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: Recommended way to have Dialogue System handle music?

Post by Tony Li »

Hi,

It depends on how you're handling your music in general. At the most basic, you could use the Audio() sequencer command in a dialogue entry node's Sequence field. Specify the name of the GameObject that has your music Audio Source. For example:
  • Dialogue Text: "Whoooo disturbs my eternal sleeeep?"
  • Sequence: {{default}}; Audio(Mysterious Song, MusicManager)
If you're using something like Master Audio (see Master Audio Support), you can use Master Audio-specific sequencer commands such as MAChangePlaylist(). Third party audio assets like Master Audio provide advanced audio features such as ducking and transitions.

You can also write your own custom sequencer commands (see here). The process is easy if you're moderately comfortable with scripting.
ilike2d
Posts: 4
Joined: Mon Jan 22, 2018 2:14 am

Re: Recommended way to have Dialogue System handle music?

Post by ilike2d »

Thank you for the tips and suggestions Tony! I will give one or more of them a shot within the next few days.
Post Reply