Search Unity

Animation not playing after I build the exe

Discussion in 'Scripting' started by nostalgicbear, Feb 12, 2016.

  1. nostalgicbear

    nostalgicbear

    Joined:
    Mar 21, 2013
    Posts:
    99
    Hi everyone,
    When I run my game, all animations play perfectly when they are supposed to play. However when I build the exe, one of the animations does not play, even though it works in the editor, and it is executed in the same function as all the others.

    The object is not static or anything like that, and as I mentioned, it works in the Unity editor. Im using Unity 5.1.3, and I dont get any errors in my logs.

    Does anyone know what could be wrong?
     
  2. GamesOnAcid

    GamesOnAcid

    Joined:
    Jan 11, 2016
    Posts:
    283
    Are the animations set to only run in the Editor? If not, it could just be an exporting problem. Check your build settings and make sure everything is normal
     
  3. nostalgicbear

    nostalgicbear

    Joined:
    Mar 21, 2013
    Posts:
    99
    It was a weird one. I deleted all the contents of the library folder and then re-imported. It worked after that. A lot of the time deleting the contents of the Library folder seems to do the trick.
     
  4. bansheesoft

    bansheesoft

    Joined:
    Oct 3, 2014
    Posts:
    62
    I wanted to add a very dumb mistake of mine that may help someone. I had an older version of my scene in the build menu not the current one. This cost me a few hours trying to figure out what was not changing. Then I added a random cube and animated it.. it did not show then the light bulb weny on. Wrong scene loaded in the build menu....dumb but maybe this saves someone a few hours l lost.