Unknown Identifier when trying to load a new scene with a script.

So, I recently began using Unity and I have been creating small projects, and now I want to add a main menu. I finished making it, got a script to load my 2nd scene (the game itself, from the main menu) and it gives me "Unknown Identifier ‘SceneManager’ and whenever I change it, it still gives it to me.

any way to fix this? I also provided the code in the post.

`#pragma strict

function OnTriggerEnter (other : Collider){
if (other.gameObject.tag == “Finish”){
` }

Hope you can help :slight_smile:

Kind regards


Not 100% sure if this will help but I know the old way of loading scenes “Application.LoadLevel(level number or tag)” is now obsolete and will cause that error, I am pretty sure they now want you to use SceneManager.LoadScene. It has been awhile since I have made anything in unity but this could be your problem.

Below is the link that you can reference:

This mind seem simple, but did you add it to the build settings list of levels? I’ve forgotten many a time to add my menus there at first lol In answer CubanLinx though, Application.LoadLevel still works as it should, it’ll just throw up warnings but not errors.

I kind of fixed it. Now it doesen’t give me unknown identifier, but instead ‘Expecting EOF, found strict’

Tried changing strict to EOF, then it says Expecting EOF, found EOF’

What do I do now? `using; UnityEngine.SceneManagement;

#pragma strict

function OnTriggerEnter (other : Collider){