hi every one and happy new year
so i want to make aboss intro with auto filling text and i made this code
public class Dialogue : MonoBehaviour
{
public TextMeshProUGUI textDisplay;
public string sentences;
private int index;
public float typingSpeed;
private void Start()
{
StartCoroutine(Type());
}
IEnumerator Type()
{
foreach (char Letter in sentences[index].ToCharArray())
{
textDisplay.text += Letter;
yield return new WaitForSeconds(typingSpeed);
}
NextSentenceAuto();
}
public void NextSentenceAuto()
{
if (index < sentences.Length-1)
{
index++;
textDisplay.text = "";
StartCoroutine(Type());
}
else
{
textDisplay.text = "";
}
}
but i want to make the first word or so as the (boss name in red color or so)and the rest in normal color
like BOSSNAME(in red):I will KILL YOU (white)
Bossname: i will kill YOU
please help and THANKS