right now we are dealing with a strange issue, affecting only the preview mode of the Unity animator:
If we compare the preview mode (hitting the play button of the animation tool) with the actual keyframes, the movement of the character will look a lot different than viewing each key frame separate by moving the cursor of the timeline manually.
Current behaviour:
When viewing the animation preview mode, all animations look very different compared to their keyframes
it looks like the transforms of the IK chains wonāt move smooth along with the bones that they are attached to, but keep stuck at wrong positions, influencing their bones behaviour in the wrong way
When selecting a single key frame, the animation looks normal an the IK solverās transforms will travel to their destinated coordinates
The animations look completely normal when viewing them either keyframe by keyframe or when they are triggered in game mode. This only affects the preview of the animation window in scene mode. The IK solvers are shown in a total different position than they are supposed to.
We have also created a GIF in order to show the difference. You can clearly see the different movements of arms and legs due to the different positions of the IK solvers:
Expected behaviour:
The animations should look exactly as they are configured within the keyframes when they are played in the animation preview mode
IK solvers should move the same way as they are supposed to within their keyframes
Environment:
This behaviour can be expected in both Unity 2020.3.25 LTS with 2D animation package version 5.0.10 and also in latest Unity 2021.1 with 2D animation package version 7 on Windows 11.
Additional information:
The issue suddendly started to occur, without any modifications to the packages. Someday the issue appeared and has been resolvable by simply restarting the Unity editor for a few times, but it has now become a permanent issue, preventing our animators from doing their work because they canāt properly use the animation preview.
Please also note that we have seen that there has been an fixed issue in version 5.0.8. of Unity 2D animation that sounds very similiar to our issue (āFixed an issue where IK Solvers would not be updated when previewing an animation clip. (1364597)ā).
However, we actually had these problems beginning way later and we are currently using a version in which that issue should be actually fixed.
Hello @mrschaal ,
I recently had a look at a bug report where the user reported a similar issue. In that bug report the user animated both the bone transforms and the IK solver, causing the animation system and the IK system to fight over the final position of the bone transform. Could this be the issue in your case as well?
This has also been my first thought. You mean it might be caused by animating both the transform position or the IK solver and the transform position of the bone that the IK solver is attached to in separate keyframe properties?
But even if thatās the cause, I donāt understand why:
The animations still looks perfectly fine in Play mode
The single keyframes look as expected when scrolling through the timeline
The issue started to occur randomly and it was possible to avoid the wrong behaviour at first sometimes by simply restarting the Unity editor, before it has become a permanent issue
Even older animations that used to work perfectly fine for over a year now are suddenly broken when playing their preview, even though we didnāt make any changes to them
All the points described above speak for an issue with the Unity editor from my point of view. The position of transforms should always be the same in the Animator preview like itās in play mode or when viewing a single keyframe within the timeline. If they suddenly donāt match with each other anymore, I assume that this is a graphical issue of the Unity editor.
We have also submitted a bug report, I can send you the link via private message.
Knowing if you have one transform being both targeted by the IK system and also having its position and/or rotation being keyed and animated in a clip is a vital piece of information in this question though. If this is indeed your setup, then I am curious what you are trying to accomplish with that kind of setup, as you have two systems fighting over setting the final position and rotation of the transform.
Iām happy to take a closer look at this issue, so do send any projects and/or bug reports my way!
Hi @Ted_Wikman , many thanks for the quick reply! I wrote you a private message with the fogbugz URL to the related bug report.
In the meantime, Iāll try to figure out the current IK set-up with my animator team and if the combination of IK solver and bone position that you have described is also the case in our project.
Note: We just did a rollback to Unity version 2020.3.17 and downgraded the 2D Animation package to version 5.0.7. Using this version, all animations look like they did before in the animator preview.
I therefore assume that this fix in 2D animation package ver 5.0.8 (highlighted in the screenshot below) has something to do with our issue:
Iām experiencing the exact same issue, and I submitted a bug report for it around 3 weeks ago. I just got an update on that bug report with this reply:
Hi,
Thanks for getting in touch, we actually know about this and you can check the status here:
The is by design. When animating IK, affected bone transforms should not be individually animated. This will cause the two systems (Animation and IK) to fight each other over the final bone transform position. The fix is to either choose to animate using IK or keying individual bone transforms.
Please reach out to me if I can answer any questions or be of further help.
Thanks,
Ugnius
Customer QA Team
Iāve already replied to this, but it took 3 weeks to get a reply to my ticket last time, so Iām making a post here as this is extremely concerning.
I already explained this in my report, but animating any bones that change the position of anything in the chain breaks preview playback (the pelvis affecting leg bone positions for example). Itās not just animating bones in the chain.
This behavior is clearly not by design. The animation works correctly everywhere except during preview playback (runtime, manually looking at frames, etc).
If you could provide some additional information on this, I would greatly appreciate it @Ted_Wikman
Thank you for reaching out, @Unrighteouss . First off, sorry for the current lead time. We managed to accumulate quite a few tasks over the holidays, and we are slowly getting back to a more reasonable response time on bug tickets and general requests.
In the past bug reports, I only got to see animation clips animating bones in the IK chain. Like I previously wrote in this thread, I am not sure what the intent is and the appropriate end result would look like. However, if there are issues when animating a bone outside of the IK chain, then I fully agree that this is a bug.
In the past few days, @mrschaal and I have been in contact, and I have received a good repro project. Once we (2D Animation team) clear some more pressing matters, we will shift focus and take a proper look at this issue.
Thanks again for being persistent and letting us know more about the issue.
I apologize if Iām coming off as impatient; Iāve had to work around this bug for weeks, so I was a little shocked when I read that it wasnāt going to be fixed.
The only bone being animated in the video is the pelvis, and the IK looks different during preview playback compared to runtime. There is no special setup, Iām just using a few bones with a single Limb chain.
This behavior is very problematic for me, as Iām unable to preview what an animation actually looks like, which makes animating very difficult and much more time consuming. The video may not look like a big deal, but the result can get much worse with more complex animations.
@mrschaal found that 2D Animation 5.0.8 is where the bug first appears. I can confirm this. Testing on 5.0.7, everything works and the bug is nowhere to be found. Updating to 5.0.8 immediately introduces the bug.
I animate the pelvis, as well as the hip bone (which is a bone in the IK chain), and it still works perfectly. Something changed in 5.0.8 seems to be the cause of the bug. Hopefully that helps narrow it down @Ted_Wikman
I also tested Unity 2019.4 and 2021.2, and the bug was not present in 2019ās IK package (2.2.0-preview.1), but it was present in 2021ās 2D Animation package 7.0.3.
Thanks for your help @Unrighteouss . I had a closer look yesterday, and I believe I have found the issue. Iāll do more testing in the coming days to verify the issue and the fix. Stay tuned
Status update: I had the chance to test my fix further today and it seems like a solid one. The fix has been handed over to QA for verification. Do note that it will take some time to backport the fix if it is approved by QA. If you are in dire need of a fix, DM me and Iāll see what I can do to help you get unstuck.
I saw that the fix was going to be in 5.1.1, but didnāt realize that it was live already. I just updated my 2D Animation package and itās working great!
Thanks for the update, and thank you for fixing this!
Thanks for this Thread, I have the same problem. I use the Unity-Version 2020.3.25f1 and I cant update the Animation2D package to 5.1.1 because then I get this Error Massage:
āLibrary\PackageCache\com.unity.2d.common@4.1.0\Runtime\InternalBridge\InternalEngineBridge.cs(21,35): error CS1061: āSpriteRendererā does not contain a definition for āIsUsingDeformableBufferā and no accessible extension method āIsUsingDeformableBufferā accepting a first argument of type āSpriteRendererā could be found (are you missing a using directive or an assembly reference?)ā
And I cant downgrate because it doesnāt show it in the package manager.
What can I do?
Hello @badschti
We have discovered that the required editor API changes actually landed in 2020.3.26f1. Could you try to download 2020.3.26f1 or newer and see if the error message persists?
Hello @Ted_Wikman and thanks for the reply!
Unfortunately I canāt download the newer version right now (I have storage problems), but I just made a new animation and oddly enough now it works fine. The problem probably will occur again, but for now it is good. But I will keep this post in mind.