Page 1 of 1
Typewriter Dialogue Beeps?
Posted: Sun Feb 02, 2020 12:56 pm
by AlexNerd
Is there any way to have different dialogue beeps for different characters a la Undertale?
Re: Typewriter Dialogue Beeps?
Posted: Sun Feb 02, 2020 1:55 pm
by Tony Li
Hi,
Yup! Assign them to the typewriter effect's Audio Clip and Additional Audio Clips list. It will randomly play one of the audio clips for each character.
Re: Typewriter Dialogue Beeps?
Posted: Tue Jul 28, 2020 3:18 pm
by lardmaster
Hi, I'm sorry to revive this old thread, but was wondering if there was a way to not have the character choose a random audio clip, but rather be able to assign a specific one to a character?
Also is there a way to disable the typewriter sound and play another audio clip instead using the AudioWait() command in the sequencer for just one line, then continue to use the typewriter sound effect? Like if a character becomes angry for example.
Re: Typewriter Dialogue Beeps?
Posted: Tue Jul 28, 2020 3:44 pm
by Tony Li
Hi,
Make a subclass of the typewriter class (e.g., UnityUITypewriterEffect) and override the PlayCharacterAudio(char) method. Example:
Code: Select all
public class CustomTypewriterEffect : UnityUITypewriterEffect
{
public AudioClip exclamationSound;
protected override void PlayCharacterAudio(char c)
{
if (c == '!') // Play a special sound for exclamation marks.
{
audioSource.PlayOneShot(exclamationSound);
}
else
{
base.PlayCharacterAudio(c);
}
}
}
Then use your subclass in place of the original typewriter effect.