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 InsomniaLab · Jul 05, 2014 at 05:33 PM · animatormecanimtransition

Does it always require 1 frame per state to transition between several animator states?

I'm trying to create a 2D sprite animation using the Animator, and I ran into a problem. Using the image below as reference, I have 3 different toggles:

  • Toggle 1 transitions StateIdle to State 1

  • Toggle 2 transitions State1 to State 2

  • Toggle 3 transitions State2 to State 3

alt text

Sometimes all three toggles become active at once, and ideally I would like State 3 to begin playing immediately, but in this case 1 frame plays from both State 1 and State 2 before finally transitioning to State 3, which creates a noticeable sprite flicker.

The transition durations are set to 0, and atomic is turned off, so I'm guessing this is just the way Mecanim handles transitions (i.e. only one state and transition is checked per update)? This doesn't seem ideal, since you should be able to transition between several states during a single update.

Is there any way to not show a single frame from each state and to jump straight to State 3 using this layout? Or will I have to create a separate toggle and transition if I want to jump from StateIdle straight to State 3 without showing frames from State 1 and State 2?

Comment
Add comment · Show 1
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 Eluem · Oct 19, 2015 at 01:49 PM 0
Share

Bump.

Is this any different in Unity 5? Seems like a valuable feature.. especially considering the fact that we have State$$anonymous$$achineBehaviors now and we can use the state machines to handle logic... I don't see any reason that I shouldn't be able to flow through multiple states in a single frame, all handing different logic.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Bunny83 · Oct 19, 2015 at 04:12 PM

Well, a state machine always follows a deterministic flow. Unity seems to only allow one transition per frame. If you want to go straight from state 1 to state 3 you should have another transition that represents that. You don't need a new variable, just setup your transition conditions accordingly.

If multiple transitions per frame where allowed it would be quite easy to create an infinite loop when switching between two states within the same frame. This would result in a freeze.

A StateMachineBehaviour has several callbacks where some can only be called when an actual frame has happened. (Specifically: OnStateIK, OnStateMove, OnStateUpdate). Also transitions between multiple statemachines would be problematic as well since the order in which they are processed would depend on the current transition chain.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

How to stop mesh disappearing during Animator state transition blend time? 1 Answer

Mecanim smooth transition from arbitrary time in animation 1 Answer

Mecanim transition retargeting and conditional exit to any state? 0 Answers

is it possible to read states / transitions from mecanim in runtime ? 2 Answers

AnimatorTransitionInfo.IsName() Not Working 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