Search Unity

Question Animator Controllers: Wrong transition gets selected

Discussion in 'Animation' started by FabioZocklabs, Nov 3, 2020.

  1. FabioZocklabs

    FabioZocklabs

    Joined:
    Jul 11, 2019
    Posts:
    17
    I have a setup like this in an animation controller: states.jpg

    State2 is first after State1, so it should be selected, if the conditions are met:
    StateOrder.jpg

    But the transition to state 2 is instant and does not need interpolation. I set it up like this:
    toState2.jpg
    The transition to state 3 needs interpolation and is set up like this:
    toState3.jpg

    But instead, state 3 get always selected.

    I first thought it to be a bug, but I found the reason: Because the interpolation time is higher, State 3 needs to start earlier, and therefore the transition to state 2 is not even tested yet.

    Just setting the opposite condition for state 3 is not possible in this case, since I use a trigger as a condition.

    In my case, state 3 is not a real state, but the exit node, which always seems to use interpolation.
    I'd like to be able to just turn this off for the exit state. This seems to be the best solution in this case.

    Any idea how to do this? Or any other solutions to my Problem?
     
  2. FabioZocklabs

    FabioZocklabs

    Joined:
    Jul 11, 2019
    Posts:
    17
    Now just after writing it down, I found, you can set the exit time manually for transitions to exit. You just don't have a preview. Maybe this is helpful for someone else.