title: How can i access game object in another scene in Unity
body: <p>I'm a beginner in Unity, so...</p>
  
  <p>I want to change the sprite of a Gameobject that is in another scene, that is not the one i'm using</p>
  
  <p>This is the code from the first scene, that i want to get the Gameobject with the tag "iman", to the second scene</p>
  
  <pre><code>public class Gravidade : Move
  {
  
  void OnEnable ()
  {
      rigid = GetComponent&lt;Rigidbody2D&gt; ();
  }
  // Use this for initialization
  void Start ()
  {
      efeito.SetActive (false);
      iman_pos = GameObject.FindGameObjectWithTag ("iman").transform.position;
      imanbase_pos = GameObject.FindGameObjectWithTag ("imanbase").transform.position;
  
      targetRotation = transform.rotation;
      vidas = 3;
  
      coins = 0;
      //vidas_text = GetComponent&lt;Text&gt;();
  
      //GUIText vidas_text = GameObject.FindWithTag("vidas").GetComponent&lt;GUIText&gt;() as GUIText;
  
      rend = GetComponent&lt;Renderer&gt; ();
  }
  
  // Update is called once per frame
  
  void Update ()
  {
  
      backgrounds = GameObject.FindGameObjectsWithTag ("background");
      obstaculos = GameObject.FindGameObjectsWithTag ("obstaculos");
      allcoins = GameObject.FindGameObjectsWithTag ("coins");
      allvidas = GameObject.FindGameObjectsWithTag ("vidas123");
      powerups = GameObject.FindGameObjectsWithTag ("powerup");
  
  
  
      float dist = 1 / (iman_pos.y - imanbase_pos.y - 2);
  
  
      bool space = Input.GetKeyUp ("space");
  
  
  
      if (/*Input.touchCount &gt; 0 &amp;&amp; Input.GetTouch(0).phase == TouchPhase.Ended */ space &amp;&amp; vidas &gt; 0 &amp;&amp; lose == false) {
          PlaySound (0);
          magnetismo = !magnetismo;
          targetRotation *= Quaternion.AngleAxis (180, Vector2.left);
          lose_text.text = "";
      }
  
  
      transform.rotation = Quaternion.Lerp (transform.rotation, targetRotation, 10f * 0.5f * Time.deltaTime); 
  
  
      if (magnetismo) {
          velocity += gravityModifier * Physics2D.gravity * Time.deltaTime - (dist * dist * Physics2D.gravity * amplitudeOsc);
          rigid.velocity = velocity;
          //nbTouches = 0;
  
      } else {
          velocity += gravityModifier * Physics2D.gravity * Time.deltaTime;
          rigid.velocity = velocity;
          //nbTouches = 0;
      }
  
  
  
      if (Mathf.Abs (velocity.y) &gt; maxVelocity) {
          velocity.Normalize (); 
          velocity = velocity * maxVelocity;
      }
  
      //Debug.Log(velocity);
  
      if (iman_pos.y + 2.5f &lt; imanbase_pos.y + 0.8f)
          iman_pos.y = imanbase_pos.y;
  
      if (iman_pos.y + 2.5f &gt; tecto.y + 2.5f)
          iman_pos.y = imanbase_pos.y;
  
      //Time.timeScale = 0;
  
      //rigid.velocity = velocity;
      //Debug.Log (dist);
  }
  
  
  
  /*private void OnCollisionEnter2D(Collision2D collision)
  {
      //Debug.Log ("Perdeste!!");
      //Time.timeScale = 0;
  }*/
  
  void OnTriggerEnter2D (Collider2D other)
  {
      if (other.tag == "coins") {
          PlaySound (3);
          Destroy (other.gameObject);
          coins = coins + 1;
          coins_text.text = "x" + coins;
  
      }
  
      if (other.tag == "obstaculos" &amp;&amp; bater == true) {
          //Destroy (other.gameObject);
          if (vidas &gt; 0) {
              PlaySound (1);
              vidas = vidas - 1;
              vidas_text.text = "x" + vidas;
              //Debug.Log (vidas);
              Destroy (other.gameObject);
              BlinkPlayer (3);
              if (vidas == 0) {
                  PlaySound (2);
                  Time.timeScale = 0;
                  losemenu.SetActive (true);
                  //SceneManager.LoadScene (0);
              }
          }
      }
  
      if (other.tag == "imanbase" || other.tag == "tecto") {
          lose = !lose;
          PlaySound (2);
          Time.timeScale = 0;
          losemenu.SetActive (true);
          //SceneManager.LoadScene (0);
      }
  
      if (other.tag == "vidas123") {
          PlaySound (4);
          vidas = vidas + 1;
          vidas_text.text = "x" + vidas;
          Destroy (other.gameObject);
      }
  
      if (other.tag == "passar nivel") {
          Time.timeScale = 0;
          lose_text.text = "Victory!";
          //SceneManager.LoadScene (0);
      }
      if (other.tag == "powerup") {
          Destroy (other.gameObject);
          StartCoroutine (pw ());
      }
  
  
  }
  
  void PlaySound (int clip)
  {
      GetComponent&lt;AudioSource&gt; ().clip = audioClip [clip];
      GetComponent&lt;AudioSource&gt; ().Play ();
  }
  
  void BlinkPlayer (int numBlinks)
  {
      StartCoroutine (DoBlinks (numBlinks, 0.2f));
  }
  
  IEnumerator DoBlinks (int numBlinks, float seconds)
  {
      for (int i = 0; i &lt; numBlinks * 2; i++) {
          rend.enabled = !rend.enabled;
          yield return new WaitForSeconds (seconds);
      }
  
      rend.enabled = true;
  }
  
  
  IEnumerator pw ()
  {
  
      float timePassed = 0;
      while (timePassed &lt; 3) {
          efeito.SetActive (true);
          bater = false;
          foreach (GameObject back in backgrounds) {
              back.GetComponent&lt;Move&gt; ().speed = 15.0f;
          }
          foreach (GameObject obs in obstaculos) {
              obs.GetComponent&lt;Move&gt; ().speed = 15.0f;
          }
          foreach (GameObject ac in allcoins) {
              ac.GetComponent&lt;Move&gt; ().speed = 15.0f;
          }
          foreach (GameObject vd in allvidas) {
              vd.GetComponent&lt;Move&gt; ().speed = 15.0f;
          }
          foreach (GameObject pu in powerups) {
              pu.GetComponent&lt;Move&gt; ().speed = 15.0f;
          }
  
          timePassed += Time.deltaTime;
          //Debug.Log (timePassed);
          yield return null;
      }
      efeito.SetActive (false);
      bater = true;
      foreach (GameObject back in backgrounds) {
          back.GetComponent&lt;Move&gt; ().speed = 3.0f;
      }
      foreach (GameObject obs in obstaculos) {
          obs.GetComponent&lt;Move&gt; ().speed = 3.0f;
      }
      foreach (GameObject ac in allcoins) {
          ac.GetComponent&lt;Move&gt; ().speed = 3.0f;
      }
      foreach (GameObject vd in allvidas) {
          vd.GetComponent&lt;Move&gt; ().speed = 3.0f;
      }
      foreach (GameObject pu in powerups) {
          pu.GetComponent&lt;Move&gt; ().speed = 3.0f;
      }
  }}
  </code></pre>
  
  <p>And this is the code from the second script in the second scene, where i want to change the sprite</p>
  
  <pre><code>public class MainMenu : MonoBehaviour
  {
  public GameObject menustore;
  public Sprite skinteste;
  
  
  public void PlayGame ()
  {
      SceneManager.LoadScene (1);
      Time.timeScale = 1f;
  }
  public void Home1(){
      SceneManager.LoadScene (0); 
  }
  
  public void openstore ()
  {
      menustore.SetActive (true);
  }
  
  public void skin1 ()
  {
      //DontDestroyOnLoad (GameObject.FindWithTag("iman"));
      GameObject.FindWithTag("iman").GetComponent&lt;SpriteRenderer&gt;().sprite 
  = skinteste;
  }}
  </code></pre>