Search Unity

Using Mecanim to only change state on last Sprite of Sprite sheet

Discussion in 'Animation' started by eco_bach, Mar 15, 2018.

  1. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,601
    Hi
    Trying to use Mecanim for something it perhaps it wasn't designed for.

    Instead of just a walking cycle and an idle cycle, I also have a client supplied walking to idle transition!
    instead of
    walking > idle

    we have
    walking > walking to idle > idle

    So instead of letting Mecanim change state on any arbitrary Sprite or frame in the Sprite sheet, I can only allow a state change on the LAST frame or sprite so that it matches the first frame or Sprite of the next sequence.

    Is this possible somehow using Mecanim? Perhaps some additional scripting required?
    I haven't been able to figure out how yet so any feedback appreciated!
     
  2. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    On the walk cycle/transition confirm "has exit time" is checked. This will force the walk cycle to end before transitioning into the next cycle/state.
    Also review - has exit time - in documentation for further knowledge. ;)