- Modificato
Visual Dipping On Mixing Animations
Hey all, I've been trying to figure out this bug for the majority of the day. I recently switched from using SkeletonMecanim to SkeletonAnimation so that I could utilize my animations within Timeline. Afte rconverting all of my Mecanim animations and state machine behaviors over to use SkeletonAnimation, I noticed my transitions were not smooth. They appeared to be jittery and I noticed the visuals would actually "dip" below the collider when I had my player transition from "Airborne" to "Walk". After inspecting further, I noticed the transform on my "Visuals" object, which houses the SkeletonAnimation, was not actually moving. I read a few issues about "Mix dipping" on the forums but I'm unsure if it's what I am experiencing. Below are two GIFs attached, "NoMix" is where I have a Mix of 0 between my "Airborne" and my "Walk" animation and the other, "Mix", is with a mix of "1". The mix of 1 is long so that you can see the dip with easy. Any thoughts? Much appreciated!
Hi and welcome to Spine!
This is not the typical problem where we use the term "dipping" for - we use "dipping" when some state of the setup pose
shows through when transitioning from one animation to another.
Could you please shortly describe how you are moving the character around, so which part of the animations we see is driven by a Spine animation, and which by moving the parent object with the collider (or with physics)? Could you please post a screenshot of the Hierarchy panel, showing the setup of your character?
Thank you Harald! I've been using Spine for a little over a year but recently just upgraded to Pro
Okay, I figured the "dipping" issue wasn't the same thing I was experiencing based on the posts about it.
Regarding how I'm moving my character around, he has a capsule collider and rigid body attached to it. The "PlayerCharacter" script calculates the "next" move vector based on the Player's input and passes that vector to the "CharacterController2D" script, which adds the vector to it's current position and calls RigidBody.MovePosition. I'd be happy to share snippets if needed. Debugging the Vector that is passed to the controller script at the time of the "visual dip" the y vector is constantly -2, which is essentially the gravity calculation constant when grounded.
Here is the hierarchy of my character:
As far as the Spine visuals go, there is a child gameObject on my "Player" object that contain the standard SkeletonAnimation and an Animation Handle script that is nearly identical to the Platformer script in the Unity SDK examples provided:
Thanks for posting all the information above. I'm afraid we will need a reproduction package to find the cause of the problem in reasonable time.
Could you please send us a minimal Unity project that still shows the above problem as a zip package, to contact@esotericsoftware.com. Then we can have a look at where the problem comes from. Please mention the forum URL in your email so that we know where it belongs.
Harald, I went ahead and created a new project with the minimal amount of files and zipped the project up. Unfortunately, it's still 37 MB so I uploaded it to my Google drive and sent that email address a link. Please let me know if this is sufficient. Thank you!
Thanks for sending the reproduction package, we received everything.
We will get back to you as soon as we've figured out what's going wrong.
Regarding package size: you can always delete the Library
director before packing, it contains only the files after import to the current platform which will be regenerated anyway. This way the unzipped project size is reduced from 155mb to 5mb, packed from 37mb to 1mb .
The problem is that your root bone is below the ground level in the Jump
and Landing
animations, while it is at ground level in other animations like Walk
. As a result, when both animations are blended during the transition, it will move below the ground as expected.
Wow...How did I miss that, sorry to have waste your time lol. Thank you for spending the time on this. I greatly appreciate it!
No worries, it didn't take much time. Glad we could resolve it easily.