Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Background not visible in game view?

Discussion in '2D' started by Shadefoot, Dec 9, 2015.

  1. Shadefoot

    Shadefoot

    Joined:
    Dec 3, 2015
    Posts:
    8
    OK so I've probably done something spectacularly dumb here, but I'm struggling to see what. I was just wanting to have a bit of a play around with object placement and colour combinations, so there are no scripts or anything at this point. Literally all I have done is to drag and drop my background image into the scene (as done with the "Sky" in the 2D catch game tutorial) and create a canvas with the title text and some buttons.

    As you can see, the canvas with the text and buttons is working fine in game view. The background is visible and covers the area the camera is supposedly viewing in the scene viewer, but the background isn't showing up in the game (and if you select the camera, the camera preview is just the blank dark blue too). I haven't changed any camera settings from what it loads up by default. Anyone able to shed a bit of light on what I've done wrong?

    error.jpg
     
  2. PGJ

    PGJ

    Joined:
    Jan 21, 2014
    Posts:
    897
    Why aren't you using an UI panel for your background? (What you are doing ought to work, but a panel would be more appropriate for this)
     
    Shishir3213 likes this.
  3. Shadefoot

    Shadefoot

    Joined:
    Dec 3, 2015
    Posts:
    8
    Because, as I said, I was just wanting to try out some colour combinations first. Haven't decided whether I want a full-width UI background or a partial one, or transparent with border, that I wouldn't want clashing with what was behind.

    And as you say, what I'm doing "should" work, but my problem is "why isn't it?". Using a UI panel won't solve that problem for other parts.
     
    Last edited: Dec 9, 2015
  4. felixfors

    felixfors

    Joined:
    Aug 13, 2010
    Posts:
    178
    This is a silly question but have you tried to move the background image on the depth? I can see that the poistion is all 0 and if you havent moved the camera it should be the same with means that the camera is " inside" the image.

    Edit: I just noticed that you are using a sprite renderer and I think you need to select the texture in the project list and then go under " Texture type" and change it to " Sprite (2D and UI)
     
    Last edited: Dec 9, 2015
    lozotiso, SeanTam, npirozzi18 and 4 others like this.
  5. PGJ

    PGJ

    Joined:
    Jan 21, 2014
    Posts:
    897
    But it really shouldn't be any difference if you use a background sprite or a panel. Since you're doing UI stuff the latter seems more reasonable...
     
    theANMATOR2b likes this.
  6. Shadefoot

    Shadefoot

    Joined:
    Dec 3, 2015
    Posts:
    8
    Thank you! That fixed it :)
     
    abhirajshourya and Matttt17 like this.
  7. felixfors

    felixfors

    Joined:
    Aug 13, 2010
    Posts:
    178
    You're welcome :)
     
  8. unity_4lMrayzlk2nkDA

    unity_4lMrayzlk2nkDA

    Joined:
    Apr 14, 2018
    Posts:
    1
    I have a Similar issue but nothing shows up on my game screen
    https://gyazo.com/6f8fe50e67bc3885a3b59991ca0a78db
    Please help me I am halfway through a course and I am still powering on but I cannot test the functions as I go through. plus will need to work once it is finished
     
  9. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,712
    Try moving your camera on the x-axis until you can see your scene.

    For future reference, please create your own new thread. This one is over 2 years old.
     
  10. Matttt17

    Matttt17

    Joined:
    Jul 4, 2016
    Posts:
    1
    Something so simple! Beginner here and this comment made me feel stupid but also helped! Thank you :)
     
  11. raghuveerrohine

    raghuveerrohine

    Joined:
    Sep 20, 2021
    Posts:
    1
    just change the position of z to negative like z=-10. Then bring the camera to the center of the background image, you will get the background image. background image issue in unity.JPG