i have saved all the scene loaders but still next loader which is 3rd one is not showing , it shows play then success button going back to play button . Could you be able help me please
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class SceneLoader : MonoBehaviour
{
public void LoadNextScene()
{
int currentSceneIndex = SceneManager.GetActiveScene().buildIndex;
SceneManager.LoadScene(currentSceneIndex + 1);
}
public void LoadStartScene()
{
SceneManager.LoadScene(0);
}
}
I’m not sure I fully understand your problem, but, try checking the buttons On Click event handlers in the Inspector, perhaps you have the button wired up to go to the wrong scene.
I still don’t think I understand from your “when I play” comment and onwards. Are you saying that when you play the game it jumps straight to the win scene?
Select a scene in the Build Settings and drag it up or down to re-order the list.
You code is adding one to the scene’s build index in order to ascertain the next scene index to load. If you look in the Build Settings you’ll see the scene indexes on the right hand side of the scenes pane.
You’ll want them to be like this;
Start - index 0
Core Game - index 1
Win Screen - index 2
So, you progress from index 0 to index 1 when you click Play on the Start scene
You then progress to index 2 when you click “That’s It!” on the Core Game scene
When you click “Play Again” on the Win scene you need to loop back round to index 0, which is what your LoadStartScene method should be doing.