title: Calling my background Sprite to fill screen in Unity
body: <p>I know that there are many questions like this on the net but I haven't found a solution to my problem yet...</p>
  
  <p>I'm trying to make a background image that fills the screen. In my game, there is a canvas and inside this Canvas there is a gameObject which has attached the sprite component.</p>
  
  <p>Many solutions includes this code:</p>
  
  <pre><code>void Awake()
  {
      SpriteRenderer sr = GetComponent&lt;SpriteRenderer&gt;();
      if (sr == null) return;
  
      transform.localScale = new Vector3(1, 1, 1);
  
      float width = sr.sprite.bounds.size.x;
      float height = sr.sprite.bounds.size.y;
  
      double variable = Camera.main.orthographicSize * 4.0;
      float worldScreenHeight = (float)variable;
      float worldScreenWidth = worldScreenHeight / Screen.height * Screen.width;
  
      transform.localScale = new Vector2(worldScreenWidth / width, worldScreenHeight / height);
  }
  </code></pre>
  
  <p>But I tried it and it makes the gameobject really small.
  Any ideas?</p>