Harald wroteWelcome back. π
Thanks for reporting, you are absolutely right! I have created an issue ticket here:
https://github.com/EsotericSoftware/spine-runtimes/issues/1997
We will let you know once a bugfix has been released.
This bug has just been fixed on the 4.0 branch, and will soon be merged to the 4.1-beta branch.
A new spine-unity 4.0 unitypackage is available for download here as usual:
Spine Unity Download
Please let us know if this fixes the issue on your end as well. Thanks again for reporting!
The bugfix has been merged to the 4.1-beta branch, a new spine-unity 4.1-beta unitypackage is available as well now.
Thanks a lot, Harald, that It works now as expected π . Sorry that I didn`t check it out earlier since I thought it would not be under priority considering that it is not a system-breaking bug. :grinteeth:
But now I found another bug that is a bit more bothersome:
When root motion is used with physics2d, the animation will be jittery when colliding against another object with kinematic rigidbody2d. In both the Play View and Scene View, I can observe that the collider stopped as expected, but the animation will keep pushing forward and bouncing back, which looks like a constant vibration. I didn`t notice it before because my animations usually moved relatively slowly, and the amplitude of vibrations seems to be correlated to the speed of the movement, sometimes, it is just too minor and you will have to zoom in to notice it.
I encountered such physics behavior before root motion was implemented, and the cause was not leaving the MovePosition() inside FixedUpdate(). Therefore I checked the code of Rootmotion only to find out that you already had it there in the right place. I also tried different settings with different rootmotion bone and different skeleton files (I tried the hip bone of Stretch man), and the jitter is constantly there.
My guess is that the animation itself is updated every frame, which caused the problem. But I couldnt find out a way to change the update mode to fixed update(), therefore I couldn
t test my hypothesis.
Please check it out and I am looking forward to a solution. Thanks in Advance π
Update Edit:
Yep, it is exactly that. I found the solution to add FixedUpdate into SkeletonAnimation script from this link:http://en.esotericsoftware.com/forum/Does-Spine-support-FixedUpdate-in-Unity-4336
It is actually quite simple, so I hope you can add it to the official build with an option to switch between update mode and fixed update mode. To be frank, this is ultra essential to integrate rootmotion with physics and it is actually kind of easy, with just a few lines of additional code.
In addition, I just come up with another idea: Can you add and expose another vector2 field to either RootMotion or DeltaCompensation? the purpose is to add other influence of velocity onto the rigidbody such as standing on a moving platform. The problem with MovePosition() method in Unity is that only the last time it is called in each frame counts, so we pretty much have to factor other velocity influences onto the RootMotion component. Thanks :grinteeth: