Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
0
Question by JonK · Aug 11, 2013 at 06:47 PM · animationmecanimtransitionanimation-blending

Mecanim - transition from run to jump

I'm trying to have the character transition from run to jump when the jump button is pressed but it often doesn't transition to the jump animation. It instead continues to play the run animation while in the air.

If anyone can tell me why this is happening that would be great or if there is a better way of doing this.

This is the whole Layer

alt text

This is the transition from run to jump

alt text

mecanim 1.png (71.4 kB)
mecanim 2.png (15.2 kB)
Comment
Add comment · Show 3
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 Benproductions1 · Aug 11, 2013 at 11:20 PM 0
Share

Does this only happen when you try to transition from Run to Jump or does this "bug" also happen when you try to transition to the other jumps?

Also make sure that "Jump" is actually true when you "Jump"

avatar image JonK · Aug 12, 2013 at 03:44 AM 0
Share

I get the same result for walking and Jump is true every time Jump is pressed.

avatar image Benproductions1 · Aug 12, 2013 at 03:58 AM 0
Share

Could it be that your jump is only true "as long as" jump is pressed? $$anonymous$$eaning it's related to the "key" and not the acctual character?
Perhaps you should heck wether the character is on the gound ins$$anonymous$$d :)

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by JonK · Aug 12, 2013 at 04:39 AM

I was checking this way

        bool grounded = CM.IsGrounded;
         anim.SetBool("isGrounded", grounded);
         
         if(grounded)
             anim.SetBool("Jump", false);
         
         anim.SetBool("Falling", CM.Falling);
         
         if(CM.Falling)
             anim.SetBool("Jump", false);

I changed it to this

      if (currentBaseState.tagHash == jumpState)
         {
             
             if(!anim.IsInTransition(0))
             {
                 anim.SetBool("Jump", false);    
             }
         }

It now works 100% of the time but will sometimes play the run animation in the air for a few fractions of a second.

Is there a way to transition from one animation to another from any point in the animation?

i.e. if I jump at 0.1 sec into the run animation or at 0.25 sec into the animation I will get the same results.

Comment
Add comment · Show 1 · 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 Benproductions1 · Aug 13, 2013 at 01:20 AM 0
Share

$$anonymous$$ark the answer as correct :)

I suggest splitting up the animation into seperate clips, so that you can transition back from each. This avoids having very weird transitions

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

16 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

Related Questions

Animation will not Return to Proper State 2 Answers

Mecanim animation transition 0 Answers

Adding animation transition between idle and walk 1 Answer

Why, when I delete transitions from the Animator State Machine, do I get a null reference exception? 3 Answers

Mecanim - How to use "Exit Time" for a state that uses negative speed (anim playing backwards)? 2 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