- Modifié
Blending two animations in Unity causing different effects
- Modifié
SOLVED! Replied with solution.
Hello,
I'm an animator using Spine trying to sort out an animation/Unity issue that is not clear at all as this particular test works for some characters, and not at all for others. For the ones it doesn't work for, we've gone so far as to strip them of all constraints, most bones, except root and all but one slot/attachment to be able to see the motion in Unity. Each item represents a full character skeleton that I stripped away for NDA purposes and to display limited hierarchy issues. In the attached examples - you'll see some extra slots and pieces that were left when recreated for the recordings. They don't affect the end results in the examples.
Specs: We're using Unity 2019.3.0f6 on Win10 and the latest Spine 3.8.95 and have the Spine-Unity 3.8 Package installed. Export settings have been double checked, are in the attached image, and are identical for each character.
First - the intended effect:
For this test, we use a button press. We want a 'Hit' animation within each character's skeleton to blend the entire character to the left a tiny bit and resetting back to normal position when hit. This hit animation has a translation on the root bone and absolutely no other keys so it looks like a jolt to the left, easing back into position. The Hit animations were made from scratch so no leftover keys anywhere. Simple.
The custom script triggers the hit blend - the base animation playing is the idle animation with a simple up and down motion. No other keys.
Second - Testing: We've tested animating a bone that is parented to the top root but that yielded the exact same incorrect behaviour you see on the floating piece for EVERY character. Changed it so it was on the top root, and it worked/works
for only a few characters.
We've tested removing Draw Order keyframes, attachments, events, turned on and off different export settings
and turning animation cleanup OFF is the only thing that yielded positive results. Currently I'm not sure if I can provide any Unity code because of NDA
I'm still very junior at this job
but I will see if I can get permission tomorrow if you need it for the button press test code, however I'm confident our programmer knows what they're doing with it.
Thank you for your time and consideration!
Ugggh sorry, I put it in the wrong forum.. Can I get it moved to Unity please?
stikkanimate a écritUgggh sorry, I put it in the wrong forum.. Can I get it moved to Unity please?
No worries, we find it anyway. Thanks for the detailled writeup.
stikkanimate a écrit[..]and have the Spine-Unity 3.8 Package installed
Are you using the latest 3.8 spine-unity package? You could have a look at the include Spine/version.txt
file that is included in the package, it shows the version (date of the package) of your spine-unity installation.
Currently I'm not sure if I can provide any Unity code because of NDA
I'm still very junior at this job
but I will see if I can get permission tomorrow if you need it for the button press test code, however I'm confident our programmer knows what they're doing with it.
I'm afraid we will need a minimal reproduction Unity project that still shows the problem, you can send it as a zip package to contact@esotericsoftware.com, it will be only seen by us. You can replace any atlas textures with white textures (of the same name) to not violate your NDA. The code should be minimal as to only contain the necessary Spine-API calls and no unnecessary game logic (I assume your button-press demo scene would be good).
Thanks Harald, I'm just going to be waiting on permissions to send you an email with the files. I've found deleting the custom shader we use turns the images purple with the function still behaving the same way so I figure that should be ok. I'll send an email within the next 15-20 minutes
Also using Package version: spine-unity-3.8-2020-06-18.unitypackage
I've emailed the Unity file. Thanks!
Never mind!! We found the issue! The bones that are having a blend animation applied to them must have a row of keys on them or else the blend just adds some reckless value for the duration of the blend's time.
Thanks for getting back to us, glad you figured it out!
Here is a quite compact posting by Nate that explains the problematic of additive animation:
Additive Track Scaling Problem