Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice

[5.2.1p1] Problem when mecanim animation on the first frame

Discussion in 'Animation' started by StriderSeiryuu, Sep 28, 2015.

  1. StriderSeiryuu

    StriderSeiryuu

    Joined:
    Oct 9, 2012
    Posts:
    3
    I've game objects with mecanim animation attached, that will be used throughout the game. The mecanim state machine is really simple with default state will play the effect when it is instantiated.

    Everything went perfect, until recent upgrade to Unity 5.2.1

    The first frame game object get instantiated, It won't start playing the default mecanim state immediately. But it shows the prefab visual for a brief moment then start playing the animation.

    This happened all over the place in our game. The only workaround I can think without downgrade to 5.2.0 is to setup prefab state to be exactly the same as the first frame animation would be, and I feel that's not quite right.

    -------------------------------------------------------------------------
    Example scene:

    simple game object with mecanim setup. (the prefab shows scale 1,1,1 image)


    this is what happened when it get instantiated in Unity 5.2.1 (it shows the prefab state for 1 frame before the animation is play properly)


    this is what it should looks like (in previous Unity)


    also I've tried legacy animation system setup for this case and it works fine.
     

    Attached Files:

    Last edited: Sep 28, 2015
    super77gg likes this.
  2. StriderSeiryuu

    StriderSeiryuu

    Joined:
    Oct 9, 2012
    Posts:
    3
    Just noticed 5.2.1p1 is out. will retest on that version

    Updated: 5.2.1p1 , the problem still persist :eek:
     
    Last edited: Sep 28, 2015
  3. Gizmoi

    Gizmoi

    Joined:
    Jan 9, 2013
    Posts:
    327
  4. febix

    febix

    Joined:
    Jun 2, 2013
    Posts:
    11
    I also have exactly the same problem (. Until upgrading from 5.1.2 to 5.2.1p1 everything works fine...
     
  5. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    5,811
    Have you reported it as a bug?
     
  6. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,580
    I have this problem too. Noticed it when upgrading from 4.6.8 to 5.2. Will look at submitting a bug now.

    Done. Now waiting for number.

    Ok, bug is #732265.
     
    Last edited: Sep 30, 2015
    karl_jones likes this.
  7. Mahdi-Jeddi

    Mahdi-Jeddi

    Joined:
    Dec 21, 2012
    Posts:
    27
    I also have this problem, already filed a bug report and they said that it's a duplicate and they're working on it. So, fingers crossed.
     
  8. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,580
    I got this back from Unity.

    "We have identified this issue as a duplicate of an existing known bug and we will be closing the issue. The information you have supplied will help us further in the resolution."
     
  9. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    5,811
    Yes the issue is fixed, it should be in a patch release in the near future.
     
    levykin, febix and andymads like this.
  10. StriderSeiryuu

    StriderSeiryuu

    Joined:
    Oct 9, 2012
    Posts:
    3
    Awesome Thank a lot :D
     
  11. febix

    febix

    Joined:
    Jun 2, 2013
    Posts:
    11
    Thank you very much! :)
     
  12. OsefOsef123

    OsefOsef123

    Joined:
    Jun 30, 2013
    Posts:
    3
    @karl.jones That's great! Any idea when this patch will be released?
     
    super77gg likes this.
  13. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    5,811
    Should be in 5.2.1p3. Due out soon.
     
  14. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,580
    It's not listed in Fixes.
     
  15. super77gg

    super77gg

    Joined:
    Sep 25, 2014
    Posts:
    46
    I just tested in 5.2.1p3 and it seems to have fixed this issue for us! Thanks guys!
     
    karl_jones likes this.
  16. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    5,811
    Yeah its in 5.2.1p3, seems the developer had some technical issues when updating the release notes. Will get them updated soon.
     
  17. WendelinReich

    WendelinReich

    Joined:
    Dec 22, 2011
    Posts:
    226
    @karl.jones, could you tell me if these fixes already did go or will go into the 5.3 beta releases, or is 5.3 currently lagging w.r.t. these bugfixes? I would love to get started with additive animations, but not if other parts of Mecanims are still broken :)
     
  18. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    5,811
    It went into 5.3 beta 2.
     
    WendelinReich likes this.
  19. TitanUnity

    TitanUnity

    Joined:
    May 15, 2014
    Posts:
    180
    We also have this issue in 5.2.3p2, no chance this would be rolled into a 5.2.3pX patch?
     
  20. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    5,811
    Its possible however 5.3 will be out next week before any new patch releases for 5.2. Can you switch to 5.3?
     
  21. TitanUnity

    TitanUnity

    Joined:
    May 15, 2014
    Posts:
    180
    We will try 5.3 and fingers crossed hopefully it works... it's been a bumpy road upgrading each time for us. Here has been our experience:

    We had a stable build in 5.1.3p3, however, due to a unity confirmed issue with IL2CPP, we were unable to build to iOS.
    So we upgraded to 5.1.4, which seemed great at first, but we experienced massive performance spikes due to a confirmed bug with font caching for dynamic fonts. We then overhauled our font system with a custom solution that fixed this issue. Later unity released 5.2.x, which fixed the font problem, but introduced a new unity confirmed bug where 2d texture memory could double in size because of an error with the new ETC1 (split alpha channel) option. Then we moved to 5.2.3, but unfortunately the font cache bug returned. Finally we moved to 5.2.3p2 and had success! The texture sizes looked good and font issue was resolved.... unfortunately then this issue with animators came up.

    So bottomline, I hope 5.3 does it, but since we're getting really close to launch, I'm always afraid of the unknown bugs the new release will introduce. I'll keep you posted as 5.3 comes out.
     
  22. TitanUnity

    TitanUnity

    Joined:
    May 15, 2014
    Posts:
    180
    Hmmm, well, upgraded to 5.3 today... and so far everything looks solid, except that unfortunately the first frame issue remains.... any update on whether this fix was included in 5.3.0f4?
     
  23. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    5,811
  24. TitanUnity

    TitanUnity

    Joined:
    May 15, 2014
    Posts:
    180
    Ok, I submit a bug report and linked back to this thread.
    https://fogbugz.unity3d.com/default.asp?751714_fqhkeomk9d3sufet

     
    karl_jones likes this.
  25. MaximeBeaudoin

    MaximeBeaudoin

    Joined:
    Jun 5, 2015
    Posts:
    2
    Hi, I have the same issue (with 5.2.3), and I was wondering if there's an incoming patch for this issue on 5.2.3pX? I really don't want to upgrade to 5.3 unless absolutely necessary. We're mostly in the same situation as TitanUnity: we're close to launch and don't want to take unnecessary risks with a version upgrade.
     
  26. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    5,811
    Its unlikely that a fix will make it into 5.2, the issue was closed as fixed so it now needs to be reinvestigated to see what's gone wrong. Getting it fixed and ready for the last patch is unlikely.
     
  27. TitanUnity

    TitanUnity

    Joined:
    May 15, 2014
    Posts:
    180
    Hey just to let you know, 5.3 seems pretty stable for us in every other regard... I was worried it would create a ton of other new problems but so far so good. Only problem for us is this first frame issue, which I have to assume several people are having. Looking for a workaround, but haven't found one yet...
     
    MaximeBeaudoin and karl_jones like this.
  28. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    5,811
  29. TitanUnity

    TitanUnity

    Joined:
    May 15, 2014
    Posts:
    180
    Here is a quick gif from our game that shows the error... you can see when I open our shop, buttons within the shop flicker. In the OnEnable method of our shop interface, as an example I set the state for the $4.99 button and Restore button to be disabled. The shop should open with the buttons properly disabled. Previously this worked in 5.1.4.

    Since 5.2.3 (including 5.3.0f4), the buttons now display their default state (Up) for a brief moment, then transition into my disabled state. I have yet to find a way to set the state properly without the flicker.

    I will try to upload a repo project, but that will take a bit of time...

    OpenShop.gif
     
    Last edited: Dec 8, 2015
  30. MaximeBeaudoin

    MaximeBeaudoin

    Joined:
    Jun 5, 2015
    Posts:
    2
    Thanks for the info! However, I'll just hack my way through every instance of the bug and patch it in code, I don't have any reason to upgrade to 5.3 if this isn't fixed. :(
     
  31. TitanUnity

    TitanUnity

    Joined:
    May 15, 2014
    Posts:
    180
    Ok good news, I was able to create a simple repo project. With a single button that opens a disabled interface. You'll notice when the interface panel opens, the button that should be in the Disabled state flickers for a frame to the default state, then proceeds:

    FlickerProject.PNG

    You can download my project here:
    https://drive.google.com/file/d/0BwL7QqsvL2_EenlncDJQT0xKTVk/view?usp=sharing
     
    Last edited: Dec 8, 2015
    karl_jones likes this.
  32. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    5,811
    It says i need access to download.
     
  33. TitanUnity

    TitanUnity

    Joined:
    May 15, 2014
    Posts:
    180
  34. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    5,811
    QA have verified the issue and it is now with the Mechanim team. Seems to be an issue with using animator override controllers.
     
    super77gg likes this.
  35. Gizmoi

    Gizmoi

    Joined:
    Jan 9, 2013
    Posts:
    327
    I am still getting this same issue and I don't use any Override Controllers. This bug has been holding our team backing from upgrading since Unity 5.1.4f1 :(
     
  36. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    5,811
    It could be the same issue or something else then. Can you submit a bug with an example project so we can check?
     
  37. ortin

    ortin

    Joined:
    Jan 13, 2013
    Posts:
    221
    Not really.
    I've downloaded the test project from TitanUnity and changed override controller to normal one and just replaced default animations and it's still flickering.

    Showstopper bug for us as well.
     
  38. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    5,811
    Well QA's comment was that is looked like an issue with animator controllers, once the Mechanim team have looked at it they will be able to get a better idea.
     
  39. TitanUnity

    TitanUnity

    Joined:
    May 15, 2014
    Posts:
    180
  40. TitanUnity

    TitanUnity

    Joined:
    May 15, 2014
    Posts:
    180
    Ugggggg, here is a message I just got from QA team:

    We're in a bit of panic mode right now, because there hasn't been a stable build of Unity since the 4.6 series for us. Literally every single version of Unity since has introduced at least 1 show stopper problem. We're looking to push builds to the app store and play store next week, not sure what to do.
     
  41. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    5,811
    OK i spoke to the dev who says it should be safe to backport. I'll do the backport now and providing it does not fail any of our tests and goes into the patch branch in time then it should be available mid next week in the first patch. I must stress there is no guarantee it will make it in time, if an issue is detected then it will be delayed and there is always a chance the patch could be delayed. So make a plan B.
     
  42. TitanUnity

    TitanUnity

    Joined:
    May 15, 2014
    Posts:
    180
    Ok thanks for the update! IF you need more Pizza, Coffee, Beer, or Tequila let me know..
     
    karl_jones likes this.
  43. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    5,811
    Good news! We made it into the first patch. Now providing nothing goes wrong that should be out this week :D
     
  44. TitanUnity

    TitanUnity

    Joined:
    May 15, 2014
    Posts:
    180
    Thanks Karl, do you know if the fix for this first frame issue will be backported into a 5.2.3 patch this week as well? I only ask because there are 2 Unity bugs between us and release:

    The first frame issue ( bug currently also exists in 5.2.3p3 ):
    http://issuetracker.unity3d.com/issues/first-frame-of-animation-displays-default-state-of-the-object

    Sustained performance problem (bug introduced in 5.3):
    Case 753047 - SpriteRenderer spike in TransparentGeometry in 5.3

    If the patch you mentioned would apply to 5.2.3 also, we would consider reverting back since the second problem was not introduced until 5.3.

    At this point we're just trying to find a stable build to launch from. Thanks!
     
  45. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    5,811
    No unfortunately the fix is not in 5.2 and its now too late to get it in, 5.2 patches are now closed as its being prepared for release. It wont have been backported yet as the actual fix has still not gone into our mainline, I had to make a custom fix based on it for 5.3. A developer is working on 753047 but I don't have any new information at the moment.
     
  46. TitanUnity

    TitanUnity

    Joined:
    May 15, 2014
    Posts:
    180
    Confirmed, first frame animator problem appears fixed in 5.3.1!
     
    Gizmoi, super77gg and karl_jones like this.
  47. Wrymnn

    Wrymnn

    Joined:
    Sep 24, 2014
    Posts:
    312
    Do you have to remove and re-create animator/animation from scratch?
    We have Unity 5.3.1 and the issue is still there.
     
  48. TitanUnity

    TitanUnity

    Joined:
    May 15, 2014
    Posts:
    180
    We didn't have to make any additional changes.
     
  49. Phazeshift

    Phazeshift

    Joined:
    Jan 31, 2016
    Posts:
    3
    It seems this issue is still in unity 5.3.2p4. If your first animation starts with the image at 0 alpha (invisible) when the animation starts, one frame will flash of the default state of the image prior to starting the animation. The only way around this for me at the moment is to drop the alpha of the image to 0 in the editor so when it flashes its already invisible.
     
  50. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    5,811
    Can you create a bug with a sample project? The original issue is now fixed, this could be something else.
     
unityunity