Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 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
2
Question by PauliusFatmap · Mar 05, 2017 at 03:30 PM · animationmecanimstate-machine

Is it possible to exit any state in sub-state machine?

I'm trying to create a logic, where no matter which state I'm in I want to exit state machine (and go to parent level). I could connect every state to ExitNode, but that seems like a lot of duplicated transitions. My initial idea was to connect AnyState to Exit node, but that is not allowed.

So how do I do that in Mecanim?

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

3 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by jeango · Aug 29, 2020 at 10:26 AM

Hi, I know this is a pretty old question and all, but since I've had to look some stuff up myself, I thought it's worth answering.

The "Any State" state is not contextual to your sub-state machine, Any State refers to any state in any sub-state machine, not just the current one. So "Any State" should serve as an entry point to your sub-state machine rather than an exit point.

It makes no sense to have an "Any State" transition from your sub state machine to the lower level because well you could just as well do that from the top level itself.

This being said, if you really want a transition from ANY state to the exit node, then the solution is to create an empty node, transition from any state to that node, and make sure that transition has "Can Transition To" unchecked (this means that your empty state can't transition to itself from the Any State, preventing endless loops) and then have that empty state transition to exit.

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 nek0pi · Dec 21, 2020 at 01:14 PM 0
Share

Thanks for clarifying that any state is not contextual. Helped me a lot with understanding why is it set this way!

avatar image
0

Answer by ggendron · Apr 02, 2019 at 09:56 AM

I'm very interested having an answer to that.

Couldn't we at least have an option to make the parent State Machine's transitions/conditions override anything in the active subState Machine (and therefore not needing the Exit node to be entered in order to exit the subStateMachine)?

In the current system I need to make a transition from each state in the substate machine to the exit node and it gets the graph totally unreadable (and losing lots of time everytime I make a change)

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 gkinder81 · Apr 27 at 09:03 AM

One workaround that may work in certain scenarios is to use a blend tree instead. That way you only have one state containing multiple animations to worry about. A tutorial showing how to do this for multiple idle animations can be found here - https://youtu.be/OCd7terfNxk

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

8 People are following this question.

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

Related Questions

Mecanim: different animations for a node 1 Answer

How do you check to see if an animation is playing in a Sub-State machine? 0 Answers

Mecanim : reference state machine animation 0 Answers

Mecanim. Why cant I get current state name? 1 Answer

Mecanim Tutorial lacking animation? 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