`SceneManager' does not contain a definition for `LoadScene'

using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;

public class SceneManager : MonoBehaviour {

	public void ChangeScene(string changeSceneTo)
	{
		SceneManager.LoadScene (changeSceneTo);
	}
}

How can you make such mistake. Look at the name of your class, it’s “SceneManager” and you are making a call to SceneManager.LoadScene(…);

And since you are also using the namespace of UnityEngine.SceneManagement; which also contains a class called SceneManager.

Now the compiler gives priority to the native class i.e. your SceneManager and when you make a call for load scene it looks for the method in your class and couldn’t find it thus giving out a definition missing error.

Now there are two possible solutions:

  1. either change the name of your class
  2. instead of SceneManager.LoadScene use “UnityEngine.SceneManagement.SceneManager.LoadScene(…)”

this should do. Also make sure you have included your scene in the build setting and the string input matches with the scene name. :slight_smile:

https://www.reddit.com/r/Unity3D/comments/4155n1/scene_manager_missing_definitions/,https://www.reddit.com/r/Unity3D/comments/4155n1/scene_manager_missing_definitions/