I seem to have done something and have no idea how to fix it.
I am getting multiple warnings from different assets saying “sceneLoaded’” problem. I have posted a screenshot below.
I have Googled it but all I could see what scripting threads.
I am rubbish at scripting. (I plan to learn, but as yet have no idea.)
What do I need to do to remedy this please. So I can continue with my project.
Hello and thank you for the reply.
Im not sure what yo mean by a class? would that be a folder or empty object, or script?
I just did a search and in Hierarchy there is only 2 "scene_root entries.
So I checked in Project and there is one SceneManager script (I have posted it below.
The class is what is inside the script:
public classClassname : MonoBehaviour
The problem is that unity already has class / script called SceneManager.
If you have a script with the same name unity does not know it you mean your class or the unity class if you do
SceneManager.LoadScene("OtherSceneName");
Two ways to go about this:
Do not use names of unity classes for your own classes.
Specify what version of “Scenemanager” you like to use for the specific calls
SceneManager.LoadScene(“OtherSceneName”);
has to be extended to
UnityEngine.SceneManagement.SceneManager.LoadScene(“OtherSceneName”);
that way unity knows that you mean the class that unity provides.
Thank you for the help. At least I know its repairable.
And I hear what you are saying, but I dont know how to go about it.
I just went into visual studio, and did a search for
SceneManager.LoadScene(“OtherSceneName”);
SceneManager.LoadScene
And couldnt find either in the script.
All I can find is
public class SceneManager : MonoBehaviour {
In line 6
Is this the line that I need to change?
And if so what to please?
Oh Thanks I did that and put UnityEngine.SceneManagement.
In front of two lines in the fungus warning, and it went gren (the little bar at the front.)
BUt then I cam to the next warning below. and have no idea what to do here…
Would it help if I just reinstalled all the warning assets?
// Make a note of the current scene. This will be used when restarting the game.
if (string.IsNullOrEmpty(saveManager.StartScene))
{
saveManager.StartScene = SceneManager.GetActiveScene().name;