To implement typewriter sounds in your game, you can subscribe to the TextAnimatorPlayer’s “
OnCharacterVisible” event and play sounds based on it.
The event passes a “char” as a parameter, so you can play different sounds based on different letters as well.
P.S. The event is not triggered with spaces.
As an example, you can install the “TypeWriter Sounds” package found inside the “Extra” folder and check its implementation.
Source: main audio source where sounds will be played.
MinSoundDelay: minimum time that has to pass before playing another sound.
Interrupt Previous Sound: If true, the previous audio will be stopped.
Random Sequence: If true, the next audio clip to play will be chosen randomly from the “Sounds” array. If false, sounds will be played subsequently.
Sounds: Typewriter sounds to play.