- Home /
Animator Transition Missing Set Conditions
I'm animating a 2D sprite, I have an animation that should be transitioning under 3 (but really technically 2) conditions: Grounded == false, velocity.z > -0.1, and velocity.z < 0.1 (so basically when velocity.z is 0).
It's an animation that should trigger at the apex of a jump, when the Z velocity zeros out. Now I've noticed the transition works when I make the jump higher/ last longer, but it doesn't work when I set the jump power to the amount I want. I feel like the animator just isn't updating fast enough to pick up on the condition. I've watched the number change on the Animator window, and it doesn't change when the Z velocity hits zero like it should. I have tried changing the Animator component's Update Mode, but all three options: Normal, Animate Physics, and Unscaled Time all yield he same issue.
Answer by troakall · Feb 02, 2017 at 01:32 PM
I Fixed it, it's an issue pretty specific to the way I have my jumping animation set up, so i'm not sure how helpful this would be to someone else. But basically I had the 'Rising' animation feed into the 'JumpArch' animation, which then fed into the 'Fall' animation. It IS true that the animator wasn't updating fast enough to tell when Z.Velocity was at zero, but it was because by the time the animator made all the proper transitions, by the time it got to the 'Rising' > 'JumpArch' animation, the Z.Velocity had passed the zero mark (which isn't the case for all jump arches but only the short-lived ones). So I made a secondary transition from 'Rising' that bypasses 'JumpArch', and goes straight to 'Fall'. Works fine, and I don't think much animation quality was sacrificed.
Answer by FortisVenaliter · Feb 01, 2017 at 07:22 PM
Does the animation transition have a defined end point (e.g. is "Has Exit Time" checked)? If so, it will keep playing until it hits it, which could cause a delay. You probably want to uncheck "Has Exit Time" so it will transition immediately when the trigger is hit.
There were some transitions that did have that turned on (by accident, because I typically have that unchecked), but the one giving me problems does have "Has Exit Time" turned off.