- Home /
GameManager.LoadLevel Not Working
using System; using System.Collections; using System.Collections.Generic; using UnityEngine;
public class GameManager : MonoBehaviour { public static int currentScore; public static int highScore;
public static int currentLevel = 0;
public static int unlockedLevel;
public static void CompleteLevel()
{
currentLevel += 1;
GameManager.LoadLevel (currentLevel);
}
}
Answer by bakir-omarov · Jun 10, 2018 at 01:49 PM
I don't see your LoadLevel method, so i assume you can change these line to:
First In the start of script add: using UnityEngine.SceneManagement;
public static void CompleteLevel()
{
currentLevel += 1;
SceneManager.LoadScene (currentLevel);
}
It will load next Scene by index. But before it, you have to add all scenes to your Build Settings . Go to File>Build Settings>Scenes in Build (big gray empty place)>Add Open Scenes (or just drag&drop all your scenes here from project folder).
Your answer

Follow this Question
Related Questions
Why The player don't move? 0 Answers
BCE0019: 'text' is not a member of UnityEngine.component 2 Answers
i need help with make an attack animation only when the player is near 1 Answer
How to make a 3D character move? 4 Answers
Simple - Visual Studio Code not loading script when icon is clicked through unity *Video provided* 0 Answers