My game has no voice over, and I am using text scrolling sounds for characters speech. I have several Syllables, and I found this script: https://adventure-creator.fandom.com/wiki/Randomize_speech_audio_(Random_Syllables)
Which is super helpful in my case. However, it says it needs a character talking animation. While in my game, most of the time the characters are having custom animations when they talk. May I ask is there a way to check if the character is talking without using the isTalking variable or talking animation?
Thank you.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
You can hook into the OnStartSpeech and OnStopSpeech custom events, which pass the character involved as a parameter:
Works as planned! Thanks!
I just encounter that when the speech is played in background, the script
speaker.soundChild.audioSource.pitch = speaker.GetComponent<SpeechAudioRandomizer>().thePitch;
Returns an error of NullReferenceException. But speaker is not null, it seems it cannot find the component in Update(). Is another way needed to get the Components attached to speaker when speech is played in background?
What's the context of this code?
Are you sure its the GetComponent that's causing the problem? It may be speaker.soundChild.audioSource, if speaker is not null.
Just found out it's my problem. I forgot to attach the correct component. My bad.