- Home /
How Can I make an Audio Dialogue?
Once again, I am making a creepypasta game called "Cupcakes" but I need help with the Audio Dialogues.
It's like when a character stops talking, I want the next or continue button to appear, and then you get to talk to the other person. And then when they're done talking I want to load up the next level.
How can I do that?
Answer by gregzo · Oct 24, 2013 at 12:44 PM
What you need ist to set up some callback when an AudioClip has finished playing. This can be done in many different ways, depending on which language you code in, your coding level, how "open" dialogue trees are etc...
If all you need is to start a clip, and do something once it's finished, just use a coroutine:
IEnumerator PlayClipRoutine ( AudioClip clip ) { audio.clip = clip; audio.Play(); while( audio.isPlaying ) { yield return null; } }
but how do I get the other character to say something after the first character is done talking? do i use c# or javascript?
you can use both
afaik you can make same behaviour in JS as in C# till now I haven't heard for 1 thing that JS can do witch C# couldn't do or the other way around