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

small delay whenever sprite is shown the first time

Discussion in 'General Graphics' started by Herold55, Jun 17, 2015.

  1. Herold55

    Herold55

    Joined:
    Apr 2, 2014
    Posts:
    5
    Whenever a particular sprite is rendered for the first time, there is a small delay.
    I know that this is because unity is loading it into memory, but is there a way to load the graphic into memory manually without showing it?

    I'd like to avoid showing it on screen just for loading, since that seems a little dirty. Also, sometimes when I put that sprite behind other sprites so it's not visible, it seems like it hasn't actually been loaded into memory since the delay is back when I show it again fully visible.
     
  2. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Try running a standalone build and see if it happens, since the editor window sometimes pauses on instantiating anything, let alone sprites. And you also say that hiding it from view does it too?

    Again, try making a build and seeing what happens, it's most likely editor lag. ;)
     
    theANMATOR2b likes this.
  3. Herold55

    Herold55

    Joined:
    Apr 2, 2014
    Posts:
    5
    It only does happen when you do a built (ios and android)
    there's no delay when you hide it.
    I'm not actually looking at editor results, since that's inaccurate in general.
     
  4. DogF

    DogF

    Joined:
    Dec 31, 2013
    Posts:
    29
    Is your problem solved? How?
     
  5. Herold55

    Herold55

    Joined:
    Apr 2, 2014
    Posts:
    5
    no, still trying to figure this out.
    Even if I show the sprite before scaled down, there's still a delay when I show it in bigger.

    I've been fighting with issues like this for quite a while now, I wonder why I couldn't find much about this online.
     
  6. DogF

    DogF

    Joined:
    Dec 31, 2013
    Posts:
    29
    Make a prefab of this unactive sprite.Then loaded in mem, use gameobject.SetActive(true) function to show it.May be work.If not try a mul thread.If not work too, try other's ideas please.