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. Dismiss Notice

Can't get Raw Image to display in-game.

Discussion in 'Scripting' started by Palimon, Oct 1, 2015.

  1. Palimon

    Palimon

    Joined:
    Apr 18, 2013
    Posts:
    225
    Hey guys, trying to experiment with displaying an image in 3D space in my game. It's not showing up, and I'm not sure why. I'm probably missing something obvious, but it's my first time using them and Google/forum searching wasn't helping. Here's what I have:
    upload_2015-10-1_12-59-21.png
    ...and there's nothing there:
    upload_2015-10-1_12-59-39.png

    Edit: Thought I should mention that I've tried a few different images, some with alpha, some without, and none of them display at all.
     
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,741
    The width and height is 1. Is it perhaps 1 pixel in size?
     
  3. Palimon

    Palimon

    Joined:
    Apr 18, 2013
    Posts:
    225
    It might be, but I started with the default of that being 100, and that didn't do much for me either :).
     
  4. Palimon

    Palimon

    Joined:
    Apr 18, 2013
    Posts:
    225
    Bump - still can't figure this out. Anyone?
     
  5. Zuntatos

    Zuntatos

    Joined:
    Nov 18, 2012
    Posts:
    612
    Well, random remarks:

    It looks like the blue axis is pointing the other way, making it show it's back.

    What are the canvas settings and what type of texture is "Modifiers_accuracy"? The icon may indicate a sprite - RawImage expects a texture2d and i'm not sure if a sprite fits in it.

    UI displays a speed of 10 km/s; if that's 10 km/s in unity coordinates as well (hopefully not), the image would probably be terribly far away and not visible due to that.

    Does it show in the scene view? Pressing T (or R? which was it. Q/W/E/R/T switch selection types) while a RectTransform is selected may give some other visual assistance.
     
  6. astechnolabs

    astechnolabs

    Joined:
    Jul 11, 2021
    Posts:
    20
    Hi,

    I am facing same issue, I used RawImage for getting dynamic image from database. I can see image in "inspector panel". but not getting show in gamePlay area. here is a screenshot.


    upload_2021-7-25_15-31-57.png

    upload_2021-7-25_15-32-39.png
     
  7. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    10,529
    Rather than resurecting a post from 2015 which had no solutions, you're much better off starting your own in the correct UI forum here.
     
    astechnolabs likes this.
  8. astechnolabs

    astechnolabs

    Joined:
    Jul 11, 2021
    Posts:
    20
  9. exiguous

    exiguous

    Joined:
    Nov 21, 2010
    Posts:
    1,749
    Melv its sunday. Never off-duty?

    It's hard to see but it seems the Color is set to white with alpha = 1. Maybe try an alpha of 0?
     
    astechnolabs and MelvMay like this.
  10. astechnolabs

    astechnolabs

    Joined:
    Jul 11, 2021
    Posts:
    20
    Actually I tried with alpha 0.5 & 0 too, but it's not issue it's just for showing position of rectangle., is there any other setting for RawImage?
     
  11. exiguous

    exiguous

    Joined:
    Nov 21, 2010
    Posts:
    1,749
    I have just placed a raw image under the canvas of my project, assigned a png and it just shows up. So in general it should work. Some ideas what you could check:
    create an empty project, create a raw image and assign the same file to see if it works (would indicate that something with your setup is wrong).
    Test if other images show up.
    See the documentation what the parameters do and "play" with them.
    Try a "regular" image instead.
    Play with sort order.
    But general it's hard to assist debugging UI stuff. But melv is right that the UI subforum may yield better assistance.
     
  12. astechnolabs

    astechnolabs

    Joined:
    Jul 11, 2021
    Posts:
    20