title: Unity DontDestroyOnload()
body: <p>My player is spawn in the position that he was in the previous level when the new scene is loaded. Is there any way to make a spawn point for this?</p>
  
  <p>I used DoontDestoryOnLoad function to keep the player into the next scene but when the player loaded, the player will spawn in the same x position that he was.</p>
  
  <p>public class DontDestroyPlz : MonoBehaviour {</p>
  
  <pre><code>// Use this for initialization
   void Awake()
  {
      DontDestroyOnLoad(this);
  
      if (FindObjectsOfType(GetType()).Length &gt; 1)
      {
          Destroy(gameObject);
      }
  }
  
  // Update is called once per frame
  void Update () {
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>public class MainMenu : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
  {</p>
  
  <pre><code>void OnGUI()
  {
  
  
      if (GUI.Button(new Rect(Screen.width / 1.5f, Screen.height / 8, Screen.width / 8, Screen.height / 20), "Bunker"))
      {
          Application.LoadLevel("Bunker");
      }
  
  
      if (GUI.Button(new Rect(Screen.width / 3.5f, Screen.height / 2.65f, Screen.width / 8, Screen.height / 20), "Forest"))
      {
          Application.LoadLevel("Forest");
      }
  
      GUI.contentColor = Color.white;
      GUI.backgroundColor = Color.magenta;
      if (GUI.Button(new Rect(Screen.width / 1.5f, Screen.height / 1.5f, Screen.width / 8, Screen.height / 20), "Coming Soon!"))
      {
          Application.LoadLevel("Desert");
      }
  
      GUI.contentColor = Color.white;
      GUI.backgroundColor = Color.magenta;
      if (GUI.Button(new Rect(Screen.width / 3.0f, Screen.height / 1.5f, Screen.width / 8, Screen.height / 20), "Out of Service"))
      {
          //Application.LoadLevel("Swamp");
      }
  }
  
  public void OnPointerEnter (PointerEventData data)
  {
      Debug.Log ("HERE BRUH!");
  }
  
  public void OnPointerExit (PointerEventData data)
  {
  
  }
  </code></pre>
  
  <p>}</p>