public AudioSource audioSource;
public float delay = 0.1f;
public string fullText;
public string currentText = " ";
IEnumerator DialogueWrite()
{
for (int i = 0; i < fullText.Length; i++)
{
currentText = fullText.Substring(0,i);
this.GetComponent<Text>().text = currentText;
audioSource.Play();
yield return new WaitForSeconds(delay);
}
}
public void StartDialogueWriter()
{
StartCoroutine(DialogueWrite());
}
Hey, how i can increase delay if it comes to the end of the sentence or a comma?
Like undertale’s intro scene