I have been trying to make a script for loading scene tips in my game and I was wondering how to get the tips to reset. For example, I have 15 tips that play while the scene is loading, I want to know how to get the tip to go back to tip one. Im using different scenes for each of my tips which I know probably isnt the most efficient way but it seems to work.
I am in unity version 2020.3.0f1
Here is the code I have at the moment
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class next_tip : MonoBehaviour
{
public void PlayGame()
{
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
}
here is a screenshot of some of the scenes I have for tips

Hello @ReferenceWolf
Oh, the method you have chosen is one of the worst.
The best way to do this is to create a single “tip” scene and attach a script that has a list or array of tips, showing one every TOT seconds, and starting the loop over.
In this way:
public class TipsManager : MonoBehaviour {
[SerializeField] private Text tipsText;
[SerializeField] private string[] tips;
private int index;
void Start(){
this.index = 0;
this.ShowTip();
}
private void ShowTip(){
this.tipsText.Text = this.tips[this.index];
StartCoroutine(this.WaitAndLoadTip());
}
private IEnumerator WaitAndLoadTip(){
yield return new WaitForSeconds(3f);
this.index++;
if(this.index >= this.tips.Length)
this.index = 0;
this.ShowTip();
}
}
If you want to keep your method, and I don’t recommend it, you have to create an index range between the first and last scene that shows the tips, and start the cycle again when you get to the last scene.
Hi @ReferenceWolf ! So if I understood correctly you want to load the scenes until the last one and then go back to the first. So there is a very easy way to do this is to use the “%” sign. This will fire the rest of the division. So for example you have 15 scenes. If you are at the 7th it will be: “7/15: R = 7”. Then when you are at the 15th scene the rest of “15/15” will be 0. Sorry if I express myself badly I’m French haha ^^.
Note: If you only want to make the scene count active in BuildSettings instead of sceneCount write sceneCountInBuildSettings
int _buildIndex = SceneManager.GetActiveScene().buildIndex + 1;
int sceneIndexToLoad = _buildIndex % SceneManager.sceneCount;
SceneManager.LoadScene(sceneIndexToLoad);