I have been trying to use GetActiveScene for the past 15 minutes but anyway I tried did not work. So finally I gave up and decided to cope what the unity manual gives, but still no solution I just keep getting the same error. I am at a loss and have no idea where to go from here... any help is appreciated. Ignore the variables they're for the rest of this script. Code (CSharp): using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using UnityEngine.SceneManagement; public class SceneManager : MonoBehaviour { //position of rocket x = -23.21 y = 1.52 z = 7.26 public float time = .90f; public GameObject game; public GameObject rocky; public GameObject startPoint; public GameObject endPoint; bool abled; public Text winText; public Text loseText; int Win_Lose; public GameObject FirCoin; public Text theScore; int yourScore; public Text GetKey; int maxScore; void Start() { Scene scene = SceneManager.GetActiveScene(); Debug.Log("Active scene is '" + scene.name + "'."); } The error is: `SceneManager' does not contain a definition for `GetActiveScene' Thanks!
This is because you have overwritten Unity's SceneManager with your own at line 9. Your version does not contain that method. Change your class name to something else, for example, MySceneManager.