Search Unity

Manual Sprite Animation Breaks After Building

Discussion in 'Animation' started by xdeployer, Sep 25, 2022.

  1. xdeployer

    xdeployer

    Joined:
    Sep 25, 2022
    Posts:
    12
    Hi all. I am manually loading a sprite in a script and then flipping through each slice of the sprite in the Update function. This works fine in the editor however when I build the project the animation breaks. Any ideas why this might be happening?

    BROKEN AFTER BUILDING
    broken.gif


    WORKING IN EDITOR
    working.gif
     
  2. xdeployer

    xdeployer

    Joined:
    Sep 25, 2022
    Posts:
    12
    Ok turns out the sprites are loaded in order when in the editor, but are loaded out of order during build. Instead of just saving the array I am parsing the keys to get the proper index.