- 已编辑
Strange MixBlend.Add behavior
Hi Harald and everyone :grinteeth:
I'm having some strange behavior happen when using MixBlend.Add on a higher track. I have a monster enemy, and I want to add an impact-animation on a higher track when the player hits it (so that it gets its head knocked to the side a bit when you attack it). I need this to be able to be played 'additively' on top of whatever animations the monster enemy is doing.
I made a repro of the issue - I'm not sure if its a bug or if I'm misunderstanding something so I didn't make a Bug Report.
In this repro, an "idle" animation is played looping on Track 0.
If you press the Spacebar it will play the impact-animation (called "Hitstop_L") on Track 2, and queue an EmptyAnimation to clear it out when its finished. It seems to work fine with just these two animations, no matter how many times you press Spacebar.
If you press "F" it will trigger an "attack" animation on Track 1. It also queues an EmptyAnimation to clear it out. This also seems to work fine in conjunction with the additive "Hitstop_L" animation the first time it plays. But if you play it another time, it goes totally out of whack.
Repro Unity Project: https://drive.google.com/file/d/1ZiNKwbLfYl4xAaugzc7yXrnUNRdAhugn/view?usp=sharing (Edit: Fixed link)
Spine Project: https://drive.google.com/file/d/1ky40iu3O0Cmvz89QgVSIDyi-pm-Zn12N/view?usp=sharing
I looked through some forum posts and I understand that whatever is keyed in the additive-animation needs to also be keyed in a lower-trackIndex animation. All bones that are keyed in the additive "Hitstop_L" animation are keyed on the first and last frame of the "Iddle" animation.
What seems extra strange is this:
1) Run the project, and press Spacebar to do the Hitstop_L animation, and then wait for it to finish
2) Press the F button to trigger the attack animation, wait for that to finish
3) Now press F again to trigger the attack animation. Only now does it mess up :think: :think:
Could it be something with EmptyAnimations potentially?
P.S. I see SkeletonAnimation now has a RootMotion option! :clap:
Jamez0r :P.S. I see SkeletonAnimation now has a RootMotion option!
Yes, all three skeleton components now have a Root Motion option!
At SkeletonGraphic there is now also the same Root Motion
Add Component
button.
At SkeletonMecanim
it's monitoring the Animator's
Root Motion
parameter and attaches the respective Spine rootmotion component respectively.
And thanks for reporting, I will get back to you as soon as I figured out what's going wrong.
This indeed looks like a bug. I will try to reproduce this in SkeletonViewer as well tomorrow. BTW: The boss looks awesome! 8)
Harald :Jamez0r :P.S. I see SkeletonAnimation now has a RootMotion option!
Yes, all three skeleton components now have a Root Motion option!
At SkeletonGraphic there is now also the sameRoot Motion
Add Component
button.
AtSkeletonMecanim
it's monitoring theAnimator's
Root Motion
parameter and attaches the respective Spine rootmotion component respectively.
And thanks for reporting, I will get back to you as soon as I figured out what's going wrong.
This indeed looks like a bug. I will try to reproduce this in SkeletonViewer as well tomorrow. BTW: The boss looks awesome! 8)
Hey Harald - I just updated Spine runtime to the newest, and then also keyed all of the 'transforms' on all bones on the animation that loops on Track 0. It seems like the mixBlend.Add "hit" animation is working now with no crazy stuff happening
Did you guys make a change? The only thing I did differently was to key ALL bones (for all 4 transform types) at both the beginning and end of the Track 0 animation. When I first posted I had only made sure that I was keying the bones that were used in the "hit" animation :think:
Indeed it seems that our recent changes have fixed your issue as well, that's nice! I just tested updating your reproduction project by the latest spine-unity package - it fixed it without requiring any other changes. So no need for additional keys.
I think it must have been the bugfix associated with this issue ticket here:
[runtimes] Hold previous on 3+ animations causes dipping · #1738
Harald :Indeed it seems that our recent changes have fixed your issue as well, that's nice!
I just tested updating your reproduction project by the latest spine-unity package - it fixed it without requiring any other changes. So no need for additional keys.
I think it must have been the bugfix associated with this issue ticket here:
[runtimes] Hold previous on 3+ animations causes dipping · #1738
Woohoo!
Hey @Harald, found another issue with the MixBlend.Add. Issue ticket here: https://github.com/EsotericSoftware/spine-runtimes/issues/1746
The repro project is the same unity/spine projects as before, but with an updated script on the Spine GameObject for testing this issue.
Sorry to spam you with so many things :o Thanks for your help!!
Thanks for reporting! I have posted a reply at the issue ticket:
https://github.com/EsotericSoftware/spine-runtimes/issues/1746
Harald :Thanks for reporting! I have posted a reply at the issue ticket:
https://github.com/EsotericSoftware/spine-runtimes/issues/1746
Thanks Harald~
Replied (a bunch of times :shh: to the issue ticket, lol)
Thanks for the updates, we will have a look at it!