Search Unity

Sprites not rendering on Android devices

Discussion in '2D' started by ProfessorDex, Nov 13, 2013.

  1. ProfessorDex

    ProfessorDex

    Joined:
    Nov 13, 2013
    Posts:
    1
    Haven't tried with an iOS device, but the new 2D sprites won't render on either of my Android devices. Regular objects will, but not the new sprites
     
  2. willgoldstone

    willgoldstone

    Unity Technologies

    Joined:
    Oct 2, 2006
    Posts:
    794
    This is a report we've heard from other users and we're looking into it, but please report this as a bug using Help > Report a Bug so that we have your project to test with.

    Thanks and sorry for the inconvenience.

    Will
     
  3. WillBellJr

    WillBellJr

    Joined:
    Apr 10, 2009
    Posts:
    394
    I'm glad I read about this cause for the first time I was going to attempt to upload some of this new 2D stuff to one of my tablets or Kindle.

    -Will
     
  4. softwizz

    softwizz

    Joined:
    Mar 12, 2011
    Posts:
    793
    I installed 4.3 yesterday and spent a few hours learning the sprite stuff and converting a 3D game (I was using planes as sprites) to the new 2D sprite system.

    I developed this for Android and today decided to check the build and it works 100%.

    I can see all sprites and sprite animations.

    Tested on:

    Bluestacks
    Samsung Galaxy Ace 2
    Goclever Tab R974.2

    All working without problems.

    My build settings are:
    Texture compression GLES 2.0

    Player Settings:
    Static and dynamic batching ticked
    minimum API 2.3.1
     
    Last edited: Nov 14, 2013
  5. Nassouh

    Nassouh

    Joined:
    Mar 12, 2013
    Posts:
    1
    I had the same problem, apparently it's something in the projectsettings.asset ,
    create a new project and copy the projectsettings.asset and replace your old one.

    and you should consider doing a backup for your current projectsettings.asset just in case something goes wrong.
     
  6. RvBGames

    RvBGames

    Joined:
    Oct 22, 2013
    Posts:
    141
    @Nassouh, are you sure it worked? Using a very simple scene with a sprite and a textured plane, the sprite was rendered all white while the plan was textured correctly.

    When the projectsettings.asset file is recreated the graphics level was reset to OpenGL ES 2.0, which does work. However, changing it back to ES 3.0 does not.
     
    Last edited: Apr 23, 2014
  7. RvBGames

    RvBGames

    Joined:
    Oct 22, 2013
    Posts:
    141
    Sprites are finally working on the Amazon Fire TV with OpenGL ES 3.0. We had to add a script to each sprite that sets the mainTexture on awake:

    Code (csharp):
    1.  
    2. public class SpriteShaderSetup : MonoBehaviour
    3. {
    4.     void Awake()
    5.     {
    6.         SpriteRenderer spriteRenderer = GetComponent<SpriteRenderer>();
    7.  
    8.         if (spriteRenderer != null)
    9.             spriteRenderer.material.mainTexture = spriteRenderer.sprite.texture;
    10.     }
    11. }
    12.  
     
  8. JVDesign

    JVDesign

    Joined:
    Aug 3, 2012
    Posts:
    32
    I just encountered this. I had used the animation controller to set the sprite on my character and didn't bother assigning a texture....taking one of my sprite sheets and assigning it fixed the problem.
    This was rendering fine initially when I wasn't instantiating from the prefab and just had the character in the scene.
     
  9. JaakkoKiv

    JaakkoKiv

    Joined:
    May 17, 2015
    Posts:
    1
    Had the same problem. On some android builds sprites and linerenderer worked, and on others didnt. Nassouhs solution did the trick for me. I also changed to pre-load shaders. Dont know if that has anything to do with it.