Hi Guys, i’m currently working on a Thesis project right now, and i’ve already reached the Credits section of the game, where i made it only with mouse click to change the text according to the string Index, but the problem right now is that i can’t return to Scene 0 (Main Menu) when i reached the last string index. here’s how the code goes:
void Update()
{
CreditsText.text = CreditSequence[TextIndex].ToString();
if (Input.GetMouseButtonDown(0)) {
sequence();
}
Debug.Log(TextIndex);
Debug.Log(CreditSequence.Count);
}
public void sequence() {
if (TextIndex < CreditSequence.Count-1)
{
CreditsText.text = CreditSequence[TextIndex].ToString();
TextIndex++;
}
else if (TextIndex == CreditSequence.Count)
{
Debug.Log("backtoMainMenu");
SceneManager.LoadScene(0);
}
}
there is no bug already, but the debug won’t show anything. i still don’t understand why it won’t load the first scene. it was on the last scene. anybody know why?