How to play an audio after a NPC message
How to play an audio after a NPC message
Hey, I am using the SMS Dialogue template and would like to add a sound effect that plays everytime a message is sent by the NPC but couldn't figure out how. Thanks in advance.
Re: How to play an audio after a NPC message
Hi,
Put your sound effect in a folder named 'Resources'. (You can also use Addressables, but using Resources is easier, and for just one sound effect that's frequently reused it's perfectly fine.)
Then add an Audio() command to the Dialogue Manager GameObject's Display Settings > Camera & Cutscene Settings > Default Sequence. For example, if the original Default Sequence is 'Delay({{end}})' and the sound effect file is named 'incoming', then set the Default Sequence to:
Set the Default Player Sequence to the original value of Default Sequence field -- e.g., just Delay({{end}})
For more info about playing audio and doing other related activity such as playing animation, see the Cutscene Sequence Tutorials.
Put your sound effect in a folder named 'Resources'. (You can also use Addressables, but using Resources is easier, and for just one sound effect that's frequently reused it's perfectly fine.)
Then add an Audio() command to the Dialogue Manager GameObject's Display Settings > Camera & Cutscene Settings > Default Sequence. For example, if the original Default Sequence is 'Delay({{end}})' and the sound effect file is named 'incoming', then set the Default Sequence to:
Code: Select all
Delay({{end}}); Audio(incoming)
For more info about playing audio and doing other related activity such as playing animation, see the Cutscene Sequence Tutorials.