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
1
Question by wolodo · Mar 26, 2014 at 05:11 PM · animationmecanimtransition

Mecanim animation transition

Hi!

I would like to make transition between 2 animation states: move and idle. Both are cyclic looped. I have a problem with that, because when I want to play just move, the character seems like it is trying to transit after every move animation cycle to idle animation. Than it returns back to move animation and after another move cycle again and so on...

What am I doing wrong?

My animator looks like this:

alt text

And my script looks like this:

     if(isMoving)
                 animator.speed = currentSpeed.magnitude;
             else
                 animator.speed = 1;
 
             if(!animator.GetCurrentAnimatorStateInfo(0).IsName("move") && isMoving) {
                 animator.Play("move");
             } else if(!animator.GetCurrentAnimatorStateInfo(0).IsName("idle") && !isMoving) {
                 animator.Play("idle");
             }



trans.png (23.6 kB)
Comment
Add comment · Show 5
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 moxiewhimsy · Mar 26, 2014 at 05:36 PM 0
Share

What does your transition move->idle look like?

avatar image wolodo · Mar 26, 2014 at 11:27 PM 0
Share

I do not exactly know what are you asking about. I am quite beginner with mecanim. I just drag'n droped these animations and right clicked one of them and than chose $$anonymous$$ake Transition option. Nothing more. I am sure, I am missing some option or something like that but I couldn't find any tutorial, how to achieve fluent transition. I just need something like crossfade in legacy animation system.

avatar image getyour411 wolodo · Mar 26, 2014 at 11:27 PM 0
Share

Please don't post follow-ups/comments as ANOTHER ANSWER; that is not an Answer, that is a comment. I converted it for you.

avatar image FinKone · Mar 27, 2014 at 06:10 PM 0
Share

You could make 2 tansitions to and from move in the mecanim animator rather then one. If moving, access the mecanim controller Animator.SetBool("is$$anonymous$$oving", true);

Setup and link the animator to link to the one you are talking about. It will transition back and forth based off setting the value if its moving. If its not set the animator back to false and it will transition back let me know if this is unclear and I can give more details. This is how I control my animator in mecanim ins$$anonymous$$d of using states.

avatar image wolodo · Apr 05, 2014 at 08:47 AM 0
Share

Could you please post a short pseudo code similar to $$anonymous$$e? I do not completely understand the part with Animator.SetBool("is$$anonymous$$oving", true); is$$anonymous$$oving is just my own variable used in other parts of the script.

0 Replies

· Add your reply
  • Sort: 

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

22 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 avatar image avatar image avatar image avatar image avatar image

Related Questions

Combining two animations to be one 0 Answers

Mecanim Root Motion Rotation - 180 degree turn. 2 Answers

Mecanim transition between animation help 0 Answers

How can i jump my character immediately With Mecanim 3 Answers

Need to know when a transition starts in mecanim. 1 Answer


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