Search Unity

Exit time interrupts itself

Discussion in 'Animation' started by Qriva, Nov 6, 2020.

  1. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,307
    I encountered strange behaviour of state machine and I wish someone could explain me why this happens or confirm bug if that's the case.

    As you can see on attached image I have following state transitions: [Locomotion] -> [Combo1] (left orange line), [Combo1] -> [Locomotion] (exit to upper layer where locomotion is default) and [Combo1] -> [Combo2]. I need to mention that order of transitions in Combo1 is: Combo2 then Exit.

    states.png

    Transition between Locomotion to Combo1 has one condition and it's trigger "attack" and also Combo1 to Combo2 has the same "attack" trigger condition.
    Meanwhile transition from Combo1 to Locomotion (exit) has no conditions, but there is Exit time set to 1.0 and other interruptions settings like on the image below:

    combo_exit.png

    Now, following thing happens: I set "attack" trigger to true once and never again, so state machine goes to Combo1, then animation plays as expected and as I do no action, after it finishes it transition back to Exit (Locomotion).
    This is expected behaviour, but if I change animation speed or speed multipler to 1.3 in Combo1, then transition between Combo1 -> Exit (locomotion), plays twice. I am not sure what exactly happen, but it looks like it gets interrupted in the last frame of transition and goes back to play it again.

    I found a way (dirty hack?, but I think it works) to fix that by setting exit time to 1.01, but still I really wanted to understand what is happening, or report it in case it is a bug.