Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
4
Question by cloud808 · Nov 07, 2012 at 02:47 PM · animationmecanim

Mecanim Blend Tree jerky transitions

Hi there, I'm creating a simple blend tree for my character's walk cycle from the idle state. I have 3 separate animations: forward, left turn & right turn. When I preview the motions by themselves they work fine, as well as in the actual scene.

The only issue is that if I'm holding down the forward motion, as soon as I press either turning key, my character will jerk as if he's trying to transition back to a different part in the walk cycle before he continues. All of the cycles are looped perfectly starting from the same foot on the ground, so i'm confused about why my character is doing this.

I've tried adjusting animation range (each clip is about 3sec), and although I have a loop match for cycle offset and root transform position, I'm still having issues. Can anyone give any suggestions?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
14

Answer by Stardog · Feb 22, 2014 at 02:30 PM

I think 2D Blending is the way to deal with this issue. This question was posted before they were available.

Alternatively, the cheap way to "fix" it is to use the overloads in the SetFloat function to smooth it out. Like so:

 moveV = Input.GetAxis("Vertical");
 moveH = Input.GetAxis("Horizontal");

 animator.SetFloat("MoveV", moveV, 1f, Time.deltaTime * 10f);
 animator.SetFloat("MoveH", moveH, 1f, Time.deltaTime * 10f);

Credit goes to this thread.

Comment
Add comment · Show 8 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Max_Bol · Oct 15, 2014 at 06:59 PM 0
Share

I wish to thank you a LOT from the bottom of my heart! I knew it was possible to use Time.deltaTime as a meaning to smoothing the key inputs, but I was hitting my head hard on the wall since whenever I checked around, all I found was long-side-way methods which involved integrating the time.deltaTime between the input and the setFloat. (adding additional lines so that, from your example, moveV and $$anonymous$$oveH's data change in a more smoothly amount ins$$anonymous$$d of the default instant switch.) With this and the Bleed Tree (type 2D freeform Cartesian) is making everything related to movement a walk in the park to manage. :)

avatar image supamigit · Jul 13, 2015 at 09:13 AM 0
Share

Thanks for this was EXACTLY what fixes the jerky transition from left to right... i did see something about having a 1/4 and 1/2 turns and then code the range or arc vs 1/2 n 1/4 call ups..

avatar image Wolfdog · Aug 12, 2015 at 08:00 AM 0
Share

+1 This is the solution.

avatar image rkumar1310 · Aug 12, 2015 at 08:29 AM 0
Share

This is the correct solution, Thanks a ton!!

avatar image KarlKarl2000 · Aug 12, 2017 at 12:55 AM 1
Share

O$$anonymous$$G 3 years later.. this is still the solution that fixes the crappy jitter-ing thats happening in Unity 2017's blend tree..

@Stardog you sir, are a king!

I was using this to fix my 2d blend tree jittering.

 anim.SetFloat ("vSpeed", _rigidBody2D.velocity.y, 1f, Time.smoothDeltaTime * 100f);

Sharin' is carin' https://twitter.com/Indiedoroid

Show more comments
avatar image
1

Answer by Aipaloovik · Nov 27, 2012 at 07:02 AM

I noticed when creating Blend Trees I had the same problem. What I realized is that my left turn was fine, but my right turn was jerky with stutter steps. I thought I had set the animations up to smoothly transition with the same foot landing to lead each animation. What I realized I had done instead was mirror the turn animation to get my left and right turns. When mirrored, the opposite foot was landing in the start of the animation, even though they were the same clip. Once I created a separate animation for the right turn, the problem was corrected.

Again, you specifically state that you set all your animations to start off on the same foot, so perhaps you did not make the same mistake. The only other advice I would have is to ensure that each animation starts in the same basic posture the other animations end with. Though if they all loop properly and start on the same foot, that is a given.

Are all of the animations speeds for the transition the same?

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image cloud808 · Nov 27, 2012 at 08:04 AM 0
Share

Actually the issue was that I didn't have the thighs lined up at the beginning of my range selection. If your clip starts with the legs separated, it can cause this sort of issue when transitioning. I missed that little detail in the Unity tutorial, but now it's all fixed.

There were also some weird ghost issues that would randomly occur with transition speeds with the previous release, but I haven't had the same problem since 4.0.0f7

avatar image dogzerx2 · Jul 15, 2013 at 09:20 PM 0
Share

What about mirroring the animation, and change cycle offset so it starts with the same foot as the un-mirrored animation?

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

17 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Add more bones to skeleton - vertebraes definition...? 0 Answers

How to create a 2D rig? 1 Answer

Multiple Animation Events not firing 1 Answer

Tweaking a Walk Cycle 0 Answers

With animator, ow to transit quickly from an animation, and transit back without replaying the complete animation 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges