Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Can you add exceptions to "AnyState" transitions?

Discussion in 'Animation' started by r3david, Aug 26, 2014.

  1. r3david

    r3david

    Joined:
    Jul 3, 2012
    Posts:
    5
    Is it possible to have a AnyState transition excluding one or more other states? Lets say I want that when the player is not beign controlled, from any state I will go to idle, "Except" if Im in another alternate idle animation. This is just an example, what i want is to know if there is such thing as restricting AnyState transitions.
     
  2. Mecanim-Dev

    Mecanim-Dev

    Unity Technologies

    Joined:
    Nov 26, 2012
    Posts:
    1,672
    No you cannot exclude state, AnyState transition are global.

    Did you try to add a Trigger parameter? call it something like isControlled, and then add a transition from your AnyState to idle with the condition isControlled.

    Then it up to you to write the logic that set this parameter, by example you could set this parameter only when the controller timeout and that you are not already in a Idle state.
     
  3. r3david

    r3david

    Joined:
    Jul 3, 2012
    Posts:
    5
    yap that's what I figured out, just wanted to make sure i was not ommiting anything. Thanks for the answer :)
     
  4. craig4android

    craig4android

    Joined:
    May 8, 2019
    Posts:
    113
    just googled this one and it's number one result: Better solution: uncheck "can transition to self"
     
    Rahd likes this.
  5. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    368
    Except I cant find the option "can transition to self" on my transitions from any state anymore in 2018.4.6f1
     
  6. Lad-Ty

    Lad-Ty

    Joined:
    May 7, 2013
    Posts:
    36
    Just sorting out a similar thing. Anyway, for others that reach this thread - the "can transition to self" is not a part of the state but a part of the transition.
     
unityunity