Function broken after Application.LoadLevel()

So I have a game object with the following script attached to it:

public class Enemy : MonoBehaviour {

public void MoveTo( Vector3 pos ){

  this.gameObject.transform.position = pos;
}

}

It works great, no problem until I use: Application.LoadLevel(“LevelName”). After the level reloads and I try to use the “MoveTo” function, I get this error:

“MissingReferenceException: The object of type ‘Enemy’ has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.” To confirm I’ve striped everything out of the level so there is only a single “Enemy” object.

It’s my understanding that “LoadLevel” should dump everything from memory (except things that are static of course). So I would expect the game object with the “Enemy” script attached to it to be removed from memory and then reloaded and work fine. It seems somehow the “this.gameObject” is still referencing the older game object that was deleted and not the new one that has been loaded. I don’t understand why “this.gameObject” doesn’t evaluate to the new game object. I must be missing something. Any help would be much appreciated!

Cheers!

You’re not calling the function from inside anything. I would either call it dynamically from your load function, or simply assign it under the Start() function.

I’ve done some more research and I think this problem might have to do with me using a singleton (a static class). I’ve read other people have had problems with Start() not running on objects when using a static var. Does anyone have experience using Application.LoadLevel() while using a singleton? Thank you.