Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 unityuser13 · Aug 21, 2015 at 10:19 PM · mecanimtransitions

Transition from all substates in substate machine in mecanim

I have a substate machine that contains a series of idle animations (about 6 of them currently) that are randomly selected upon entering the idle substate machine by a simple substate machine behavoir script.

According to this : http://blogs.unity3d.com/2015/02/11/having-fun-with-the-new-mecanim-features/

I now want to transition from any of these states into a locomotion substate machine when the speed parameter is greater than zero.

I tried connected the 'idle' substate machine with the 'locomotion' substate machine in the layer above the idlesubstate machine using a transition with the condition of speed > 0.

However the idles just keep playing and the transition is never done.

How do I get any of the idle animations in the idle substate machine to be immediately interupted when speed >0 and transition into the locomotion state without selecting each on and creating a transition on each one through the (Up) Base Layer and into locomotion? Because this doesn't seem a very good way to do it especially when I intend to expand the number of idle states in future.

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

1 Reply

· Add your reply
  • Sort: 
avatar image
6

Answer by Baste · Aug 22, 2015 at 09:50 AM

The state machine system has some very, very strange desicions built into it.

Setting up a transition between two substate machines does not actually do anything on it's own. You also have to use the entry/exit nodes.

So if you have a state machine transition from the substate machine Idle to the substate machine Locomotion, that will only kick off if the exit node in the Idle machine has been entered.

Sadly, there's no possible way to set up a transition which means "from any state within this machine, transition to the exit node if the speed variable is greater than 0", as the any state node within a state machine is the global any-state.

So as far as I've been able to work out, you have to have a damn transition out from every idle state. It's a real pain.

Comment
Add comment · Show 4 · 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 unityuser13 · Aug 22, 2015 at 11:03 AM 1
Share

Yes, I have many idle states, mainly because 1. There are several characters using the same animator and I don't like it when their idle animations match up and their idle animations syncronize. 2. Because depending on whether they are happy, sad, angry or normal they will have different idle stances.

Regardless of what idle animation they are in however I need them to start walking when they are commanded to by the RAIN AI I am using.

So as described above I have all the idles in a separate substate machine but I've only been able to achieve the behavoir I am looking for by running a transition from every single idle state using the condition speed >0 or direction > 0 (because they might turn but not move) so that means two transitions for every idle state, which is a lot of work.

avatar image Baste · Aug 22, 2015 at 03:23 PM 0
Share

If each of your idle animations are going to function identically, you could set this up with a blend tree. Simply replace all of the transitions to and from the idle states with a transition to the blend tree. Let the tree use the old random parameter to pick the correct idle animation.

It's not quite what blend trees are meant to do, but it'll do the job.

avatar image unityuser13 · Aug 22, 2015 at 07:39 PM 0
Share

Thanks Baste, I actually had something like that setup in unity 4, but it wasn't very pretty so since unity 5 came out and broke my old mechanim controller I thought I'd re-engineer it from scratch the way 'its supposed to be done'. Of course now I find out that there is no way its ment to be done only ways to bodge the behavoir. I'm quite disappointed because I would have thought multiple idle states and transitions to walking would be something just about everyone uses.

avatar image jwinn · Oct 21, 2015 at 06:05 AM 1
Share

Anyone also looking for this feature, here is a feedback item for it. Please add some votes to maybe get it some attention:

http://feedback.unity3d.com/suggestions/mecanim-any-sub-state-node-in-sub-states

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

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

Related Questions

Editing Animation Clips 1 Answer

Mecanim transition to 'matching' position 0 Answers

How can I change a mecanim animation by pressing a key? 1 Answer

Mecanim blend-tree transitions problem 0 Answers

Transition to multiple states from Entry Node in Unity 5 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