Hey guys I am using this;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class DialogueScript : MonoBehaviour {
public Text DialogueText;
public Text Name;
public GameObject Dialogue;
public float maxTime;
public float minTime;
public int DialogueNumber = 1;
private bool _isDone = true;
public void addDialogue(string Text, string _Name, int number){
StartCoroutine (_addDialogue (Text, _Name, number));
}
IEnumerator _addDialogue(string Text, string _Name, int number){
DialogueNumber = number;
Name.text = _Name + ":";
DialogueText.text = "";
foreach (char letter in Text) {
_isDone = false;
DialogueText.text += letter;
if (letter != ' ')
yield return new WaitForSecondsRealtime (Random.Range (minTime, maxTime + 1));
}
if (DialogueText.text == Text) {
_isDone = true;
DialogueNumber++;
if (isDone () && DialogueNumber > 2)
yield return new WaitForSeconds (1);
Dialogue.SetActive (false);
}
}
public bool isDone(){
return _isDone;
}
}
for my dialogue, it works fine. It’s just that when i go under about 0.05 on min and max time, it gets very choppy. I try to go lower but it stays the same speed. Even if i set both min and max to the same, it still varies in time for some reason.
(offtopic) This also happens when you change Time.timesclae low.
Is there any way around this or a way to make it smoother