Play/loop Audio until response selected

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Edla
Posts: 27
Joined: Mon May 04, 2020 9:23 pm

Play/loop Audio until response selected

Post by Edla »

Hi I have set up the dialogue nodes as such, I want the Audio(phonering) to play/loop until the "Pickup the phone" response is selected.
But Audio(phonering) will only play the clip once. How do I make it loop till it's stopped?

Text: Phone is ringing
Sequence -> Audio(phonering)
Response Menu Sequence ->Audio(phonering)

Pickup the phone
Sequence -> AudioStop()

Ignore it --link back to Phone is ringing node
User avatar
Tony Li
Posts: 21681
Joined: Thu Jul 18, 2013 1:27 pm

Re: Play/loop Audio until response selected

Post by Tony Li »

Hi,

The sequencer command "Audio(phonering)" will play phonering through the Audio Source component on that dialogue entry node's speaker. If the speaker doesn't have an Audio Source, it will create a default one. Instead, add an Audio Source to the speaker yourself, and tick its Loop checkbox. Or, if you want to play phonering on a different GameObject's Audio Source, specify the GameObject's name as a second parameter, such as: "Audio(phonering, Telephone)"
Edla
Posts: 27
Joined: Mon May 04, 2020 9:23 pm

Re: Play/loop Audio until response selected

Post by Edla »

Great that works.
Thanks
User avatar
Tony Li
Posts: 21681
Joined: Thu Jul 18, 2013 1:27 pm

Re: Play/loop Audio until response selected

Post by Tony Li »

Glad to help!
Post Reply