Dialogue Sounds

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
7ports
Posts: 16
Joined: Mon Jun 20, 2022 4:08 pm

Dialogue Sounds

Post by 7ports »

Hi Forum,

I was wondering if there was an event related to specific characters being displayed or an event related to an entire word being displayed that could be hooked in to. I want to play sounds on a per word basis when a character is speaking rather than on a per symbol basis. I think detecting space symbols and playing sounds using those would work as well.

Please let me know if there is a way to do either of these.

Cheers,
Raj
User avatar
Tony Li
Posts: 22118
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue Sounds

Post by Tony Li »

Hi Raj,

If you're using the Dialogue System's typewriter effect, you can hook into the OnCharacter() UnityEvent or make a subclass of the typewriter effect and override the PlayCharacterAudio(char) method. To identify a word in PlayCharacterAudio(), you can check if the current character is a non-word character such as a space or punctuation. If so, then you can go backward from there to the previous space (or beginning of string) to identify the word.
Post Reply