Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

How can I change orange animation state transitions?

Discussion in 'Animation' started by ErnestoBananez, Mar 28, 2015.

Thread Status:
Not open for further replies.
  1. ErnestoBananez

    ErnestoBananez

    Joined:
    Sep 23, 2014
    Posts:
    16
    Hi all, I'm currently trying to refactor my player character's animation system using the newfangled substate machines for animator controllers, and I'm having a slight (though annoying) issue.

    Inside of a substate machine, whenever I drag the first animation clip in to create a state, it creates the new orange (default, non-conditional) transition from Entry to this first state. When I later add more states and want the orange default entry transition to go to a different state, I... can't. Changing the 'default' orange-highlighted state (which we were all familiar with pre-5.0) doesn't change this orange 'Entry' transition, instead it just makes that state the overall first state that this entire Animator Controller starts with, like it did before:

    OrangeDude.jpg

    I'm really out of ideas on how to modify this transition. You can't delete it like any other transition. When you click on it the inspector just goes blank and gives no information, not like it does with normal transitions. I always thought it was impossible to just change where a transition is pointing, but maybe I'm wrong? That's all I can think of. They don't mention anything about this in the official tutorial, either.

    TL;DR: How do I make it so that the orange arrow points to Jump_Enqa rather than Fall_Enqa?

    Thanks much!
     
  2. Mecanim-Dev

    Mecanim-Dev

    Joined:
    Nov 26, 2012
    Posts:
    1,675
    You can right click on your state and choose 'Set as Layer Default State'
     
  3. ErnestoBananez

    ErnestoBananez

    Joined:
    Sep 23, 2014
    Posts:
    16
    NoDefaultState.jpg
    Setting the layer as the default state doesn't quite work, here you can see that Jump_Enqa is set as the default state already, but the orange transition is still not pointing to it. This method works if I'm doing this on the Base Layer, but when I try to do that in any substate machines, it only changes the orange highlighting, as I tried to explain at the end of the second paragraph above.
     
  4. pierrepaul

    pierrepaul

    Unity Technologies

    Joined:
    Jun 19, 2012
    Posts:
    162
    Hi!

    Right Click on Entry Node, and you will be able to set the default transition for that particular sub state machine.

    Hope this helps.
     
  5. ErnestoBananez

    ErnestoBananez

    Joined:
    Sep 23, 2014
    Posts:
    16
    Thank you so much! I don't know why that never occurred to me.
     
    Pioo, boutinma and theANMATOR2b like this.
  6. Carl-Gran

    Carl-Gran

    Joined:
    Jul 13, 2015
    Posts:
    12
    Hmm... it seems that all the transitions are evaluated in a list... so if the the non-conditional default transition is first in the list of transitions this always fires (which it seems to be by default)... To me it would make more sense to always evaluate the default condition last (after any user created transitions have been checked).

    Right now you can work around this by moving the default transition to another node, (which I assume puts it in the end of the list of transitions).
     
    eelstork likes this.
  7. cartoonicus

    cartoonicus

    Joined:
    Mar 20, 2016
    Posts:
    1
    What is Entry node.
     
  8. huulong

    huulong

    Joined:
    Jul 1, 2013
    Posts:
    225
    OK, I got how to do it but I think it's a bit misleading, as you may think the Default State contextual item will always set the default state in the current context, and the orange button still matches the orange arrow so it looks like you managed to set the default state on the sub-state but the arrow incorrectly points to the old default state due to some bug.

    I have a few suggestions:

    (easy)
    1. Add contextual menu item "Set as Sub-State Machine Default State" under or above "Set as Layer Default State" so users used to right-clicking on the target node rather than the entry node clearly see that they need the first option, while the second option is to set the default state on the whole layer
    Note: i see where it gets tricky with 2+ sub-state machines embedded though, you'd need to add one extra contextual item per state parent. But why not. You could also just keep the current graph (Sub-State Machine) and root graph (Layer), and only to assign default state of an intermediate parent graph, the user would have to right-click on the Entry node of that graph.

    (hard)
    2. Keep orange for layer default, and use another color for all other sub-state defaults (again, if embedding many sub-states it gets trickier, but it will make it easier to read for 2 levels at least). Now you can show some arrow coming from the (Up) Base Layer node in orange to the Layer Default, while keeping the arrow in the other color from the Sub-State Entry node to the Sub-State default.
     
  9. bparag890

    bparag890

    Joined:
    Mar 10, 2022
    Posts:
    2
    upload_2022-4-1_16-17-37.png

    hii everyone, what am i doing wrong/ missing because of which its not showing an option ,"to set as default " ??
     
Thread Status:
Not open for further replies.