Hello,
As an FYI I just started playing around with Dialogue System for Unity today
I had setup a basic scene where an NPC will bark some text from a database when the player approaches. I wanted the bark to have the typewriter effect with some sound blips, so I created a new prefab from the "Bubble Template Standard Bark UI" template and added a typewriter effect script to the text component as shown in the attached image.
The typewriter effect works as expected visually, however, there is a problem with the sound. Specifically, when I start the scene the two sound blips play even though I have not triggered the bark by interacting with the NPC. The two clips play just once on scene load. For reference, the sound works as expected when I do trigger the bark by interacting with the NPC.
How can I go about preventing these sound clips from playing when the scene loads? Is it possible I am assigning the typewriter effect incorrectly or in the wrong place?
Thanks,
Typwriter sound effects play before bark begins
Re: Typwriter sound effects play before bark begins
Hi,
Thanks for using the Dialogue System!
Does your Text GameObject have an Audio Source component? If so, make sure Play On Awake is unticked.
Also, untick the typewriter effect's Play On Enable. The bark will tell the typewriter effect when to play.
Thanks for using the Dialogue System!
Does your Text GameObject have an Audio Source component? If so, make sure Play On Awake is unticked.
Also, untick the typewriter effect's Play On Enable. The bark will tell the typewriter effect when to play.
Re: Typwriter sound effects play before bark begins
I have no Audio Source set, just the two Audio Clips. I notice if I uncheck the "Play On Enable" checkbox (see attached image) the sounds no longer play when the scene loads, but this comes at the cost of the typewriter effect not working altogether.
As an update I removed the second sound (under Alternative Audio Clips), but I still hear the first blip play twice.
As an update I removed the second sound (under Alternative Audio Clips), but I still hear the first blip play twice.
- Attachments
-
- Screenshot 2021-01-07 173120.png (177.45 KiB) Viewed 126 times
Re: Typwriter sound effects play before bark begins
I managed to track it down!
So the problem was that the text on the Text component had a default value of "Subtitle Text". I set this the text property to be empty (see attached image) and now everything works as expected.
I'm guessing what was happening is that the typewriter script would see that there is something in the text field and then it would begin to start playing the sounds as it wrote out the text, but at some point (a frame or two later) the Dialogue System would set text field to empty and the typewriter effect would stop.
So the problem was that the text on the Text component had a default value of "Subtitle Text". I set this the text property to be empty (see attached image) and now everything works as expected.
I'm guessing what was happening is that the typewriter script would see that there is something in the text field and then it would begin to start playing the sounds as it wrote out the text, but at some point (a frame or two later) the Dialogue System would set text field to empty and the typewriter effect would stop.
Re: Typwriter sound effects play before bark begins
Hi,
You can deactivate the Text GameObject. The StandardBarkUI script will activate it when it needs to show a bark. This should fix the issue.
You can deactivate the Text GameObject. The StandardBarkUI script will activate it when it needs to show a bark. This should fix the issue.