GameObject.Find() didn't work?

Hi all,
I have a game with 2 scenes: “GameLevel1” and “GameLevel2”
In “GameLevel2” scene I have an object named “Map” and have a component(script) named “Map”, too.
I want to get Map script after changing scene from GameLevel1 to GameLevel2, and I used scripts:

Application.LoadLevel("GameLevel2");
Map map = GameObject.Find("Map").GetComponent<Map>();

But at runtime, I receive an exception:

I still see the Map object, with Map script in the Hierarchy list.
Anyone can help me?
Thank you very much.

Didn’t you say that the map script was on the GameLevel1 and 2? You should be finding them instead.

Um, I think it has to be lowercase g as in

gameObject.Find("Map")

False. It’s uppercase.

Really? I’m thinking javascript…

It’s the same in every Unity language.

Wait a minute, no its not!

function Update () {
	GameObject.Find("Test").GetComponent("Test2").go = true;
        if (GameObject.Find("Test").GetComponent("Test2").go)
        Debug.Log("Works!");

}

Object Reference not set to instance of object

function Update () {
	gameObject.Find("Test").GetComponent("Test2").go = true;
        if (gameObject.Find("Test").GetComponent("Test2").go)
        Debug.Log("Works!");
}

Works!

http://unity3d.com/support/documentation/ScriptReference/GameObject.html

GameObject is a component, which means that it can a variable newGameObject : GameObject, or you can access it, transform.gameObject. From there, you can do GetComponent() or Find().

Thanks,
I tried 2nd way, but a compile error occured. Find() is a class function (static function in C#), so you can’t access it with an instance, instead of classname

You have to store it in a variable such as

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
public GameObject hand;
void Awake() {
hand = GameObject.Find("Hand");
hand = GameObject.Find("/Hand");
hand = GameObject.Find("/Monster/Arm/Hand");
hand = GameObject.Find("Monster/Arm/Hand");
}
}

http://unity3d.com/support/documentation/ScriptReference/GameObject.Find.html