Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Animated Sprite repeated several times on background

Discussion in '2D' started by kleinfb, Apr 13, 2016.

  1. kleinfb

    kleinfb

    Joined:
    Sep 21, 2012
    Posts:
    96
    Hi all,

    I seem to have an issue.

    On my game, I have a little animated sprite. Think of it as an animated square. This sprite is repeated several times over the background. Several animated sprites, side-by-side. Like, several dozens.

    That is definitely taking a toll on memory and processing. Things get real slow. I'm aware that things as batching existe, but I might not be doing it correctly. Btw, those squares always stay on same position, and always have the same size and orientation.

    What would be the best way to handle this?
     
  2. kleinfb

    kleinfb

    Joined:
    Sep 21, 2012
    Posts:
    96
    Still struggling with this.
     
  3. gtkampos

    gtkampos

    Joined:
    Aug 22, 2013
    Posts:
    6
    Show us some code...
     
  4. Hyblademin

    Hyblademin

    Joined:
    Oct 14, 2013
    Posts:
    725
    What device is the project running on? I wouldn't think a few dozen static animated objects would slow down much. Are you sure there isn't something else going on? Any fancy shaders or complex lighting situations? Batching won't save processing time, by the way.
     
  5. kleinfb

    kleinfb

    Joined:
    Sep 21, 2012
    Posts:
    96
    The issue can be observed on several different iOS devices.

    One of the things that was causing it, was that all the elements were layout elements. Removing that component from the objects highly improves performance, but still does not quite solve it.

    No shaders or complex lighting in the scene.