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
3
Question by pgomes · Feb 10, 2015 at 09:26 PM · mecanimtransition

transition priority Any State vs specified state

Consider the following Mecanim transitions: A->B and [Any-State]->B. The animation controller is in state A and the conditions for both transitions are true.

Which transition becomes active and according to what criteria?

From my understanding, you can change the priority of transitions leaving a specified state. You just need to select the state and reorder the transitions in the list. However, the [Any-State]->? transitions do not appear in this list, only in the [Any State] list.

Comment
Add comment · Show 6
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 Mmmpies · Feb 10, 2015 at 10:28 PM 0
Share

Any-State is just that, from Any-State to B, it's used for things like death where you could be running, walking, standing, swim$$anonymous$$g well any state as the name suggests.

What are you trying to use it for?

avatar image pgomes · Feb 10, 2015 at 10:41 PM 0
Share

A is Idle and B is Attack. I'm using [Any State]->Attack because you can transition to attack from almost any other state, including attack itself.

avatar image Mmmpies · Feb 10, 2015 at 10:56 PM 1
Share

Well I'm no expert on mecanim but I think any state needs to be for very specific event like death. Attack needs a more controlled method than any state.

You might get it working but it's probably better to make a more complex animator that considers what state you've come from.

avatar image pgomes · Feb 11, 2015 at 02:17 AM 0
Share

I have 9 attacks and 8 B-actions. All attacks and B-actions (17 total) can transition to one another. Thus, the number of transitions between them is the combination "17 choose 2" times 2 (bidirectional). C(17,2)*2 = 272. $$anonymous$$anaging and tuning 272 transitions is unfeasible.

avatar image mattygun · Jul 09, 2015 at 12:58 AM 0
Share

I know this is old so I don't expect this to be read, but it someone comes across this I would recommend not having the transition for A->B since it is already used inside [AnyState]->B. As for what comes first if you have both, I don't believe the order is something that you should rely on.

Show more comments

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by victor_Infinite · Apr 14, 2016 at 12:12 PM

Now with Unity state machine transtions, one option available to you is to add a statemachine that sets a boolean when entering the state, for example "preventanystate" when transiting to A and sets it to false when exiting the state.

Then in the transition from Anystate->B, this boolean is checked to be false. This ensures that B->A must be played instead.

Comment
Add comment · 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
0

Answer by pgomes · Jul 09, 2015 at 10:58 PM

From my experience so far, A->B takes priority over [Any-State]->B in a situation where both are valid.

Some of the comments bring up that you should probably try to avoid having both transitions altogether. However, in a scenario where you want to have tailored settings for a specific transition, and other settings for all other transitions, the direct alternative can cause a transition explosion.

Consider the following real scenario: I have 9 A-actions (attacks) and 8 B-actions. All attacks and B-actions (17 total) can transition to one another. Thus, the number of transitions between them is the combination "17 choose 2" times 2 (bidirectional). C(17,2)*2 = 272. Managing and tuning 272 transitions is unfeasible.

What is the solution to control this complexity? Use Unity 5 with sub-state machines. The new animation controller allows collapsing transitions by having generic transitions to a state, and transitions from entry state. This way we can have two sub-state machines, one for attacks, one for B-actions. Transitions to these two sub-state machines are made generic, instead of to specific states, and we add self transitions to each of the sub-state machines. See pictures for example setup.

alt textalt text


unity5-state-machine.png (22.6 kB)
unity5-state-machine-action-b.png (76.1 kB)
Comment
Add comment · 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

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

How to fluently transition into an animation state? 0 Answers

Copy/Paste Mecanim Transitions 6 Answers

Mecanim opposite transitions. Easy made hard? 1 Answer

Mecanim - How to use "Exit Time" for a state that uses negative speed (anim playing backwards)? 2 Answers

Why, when I delete transitions from the Animator State Machine, do I get a null reference exception? 3 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