Search Unity

Some GUI elements aren't visible in Android Device

Discussion in 'Android' started by mangustas, Jun 10, 2014.

  1. mangustas

    mangustas

    Joined:
    Oct 11, 2013
    Posts:
    15
    Hi all. I just faced a problem. When I am testing my game in desktop computer in Unity3D Editor, it's fine and I am able to see all the GUI elements of the game. But when I test the same game on my Android Device (Note 3) I am unable to see them. What could be the problem and what I should consider of chaning? I tried to align those GUI elements closer to the screen and futher, but it's the same. Also I tried to change the "Near" of the MainCamera, but I don't know if it's going to change anything. Any ideas? Thank you for any responses. Appreciate.
     
  2. NickP_2

    NickP_2

    Joined:
    Jul 9, 2013
    Posts:
    61
    If you set the aspect ratio of the editor (see image below) to something like in the image below, are you having the same problem ? it could be that the editor is showing a part of the screen that your device doesn't has, and the texture is on that part of the screen, so it falls of on the phone!
     

    Attached Files:

  3. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    If you're using OnGUI to position your GUI elements, use Screen.width / height rather than hard-coding the x & y Screen positions.

    If you're using GUITextures, don't position them using the x & y pixel inset, position them manually instead.
     
  4. mangustas

    mangustas

    Joined:
    Oct 11, 2013
    Posts:
    15
    Nick, I tried to change it in Unity Editor - no luck, I mean, it's showing me GUI elements just fine. But not on my Android Device. They are not cutting edges or something, they are invisible.

    Intense_Gamer, I'm positioning them manually. Tried changing them from Sprite to GUI (was Sprites, as simple images): created empty GameObject, added Plane, Mesh Renderer, and Material (which contains Unlit/Transparent Shader).

    Thank you both for contributing with my question. Will try some other things.

    EDIT: It's very silly situation, because one GUI element of the game is showing up, so I tried to entirely copy that GUI element with all the objects in that element, but without any luck. It's just doesn't show up.

    I also changed those GUI elements file name (from .psd to .png), but, again, without any luck.
     
    Last edited: Jun 11, 2014