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. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Manual Sprite Animation Breaks After Building

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

  1. xdeployer

    xdeployer

    Joined:
    Sep 25, 2022
    Posts:
    9
    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:
    9
    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.