Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Playables and UI animations

Discussion in 'Timeline' started by npatch, Jul 14, 2017.

  1. npatch

    npatch

    Joined:
    Jun 26, 2015
    Posts:
    123
    Hi,
    I was wondering if Playables can be leveraged for UI menu animations. I can immediately see how using Timeline plus Playables I could create modular clips for individual UI elements to control transitions from enabled/disabled states or move them in or out of the frame to transition from a View to another. But is it possible to also leverage the StateMachines from Mecanim as the graph to be used? For example ,picture a flow where you are in a state and you can play a playable clip fully(norm time 1)(or even multiple clips) and then stop and wait till a trigger gets raised to continue to another state?
    Also, I've noticed that Playable graphs always end up evaluating leaf nodes. And the inner nodes are mostly mixers/blenders. Would I have to roll my own state machine behaviour?

    The project I work on is UI heavy and it gets really cumbersome to edit animations all the time to handle transitions between Menu Views. So I'm thinking if I can create simple clips of elements as building blocks(UI element translate out of screen, UI element hide and become uninteractable, etc.) I can then have some editor tool(or Timeline if it's possible) that can define the UI graph and have support for attaching clips to states(not just one clip per state as with Mecanim).

    Thanks,
    Nikos
     
  2. Pepperoni92

    Pepperoni92

    Joined:
    Oct 26, 2014
    Posts:
    4
    Did you ever make any progress on this or come up with a solution? I'm looking for a similar solution right now. Mostly to handle UI widgets with multiple states that either have different visual changes (layout, materials, etc), or animations.
     
  3. npatch

    npatch

    Joined:
    Jun 26, 2015
    Posts:
    123
    Unfortunately I didn't do much after that. The only thing I managed, was to use the Playables Mixing to switch visibility from one view to another, where view is the panel for a single menu screen(and children). I dropped it quite early on due to work priorities and to be honest, it was not too long after the Playables API was released so there wasn't much functionality or interoperability with Timeline. And I never got around to figuring how to make a sort-of state machine like structure on top of Playables. Whenever Playables were demoed, it was always on non-UI animations but the notion of conditional skipping was occasionally used to skip to other clips on a Timeline.
    So it should be possible.
     
  4. Pepperoni92

    Pepperoni92

    Joined:
    Oct 26, 2014
    Posts:
    4
  5. simoo

    simoo

    Joined:
    Jul 20, 2019
    Posts:
    11
    Any update on this?
    I'm still really interested in understand what's the best approach to handling menu/ui animations without the overhead of relying on state machines.
     
  6. npatch

    npatch

    Joined:
    Jun 26, 2015
    Posts:
    123
    I've found this some time ago.
    Haven't used it but it seems to be able to satisfy some needs.

    One thing though, you can't really avoid an FSM one way or another. The only thing that changes is how it's implemented, by code, provided by Animator(Controller) or via Events/Signals in Timeline.

    Timeline is really good for blending visualization, but it's not good for FSM visualization. It'd be nice if Timelines could be somehow tied to the Animator window visualization where each state under the hood was some offset jump(like what Signals can do) but unfortunately it's not.

    Also the asset above has some specific features it allows. Not sure if they are enough to handle most or all of the needs the previous cumbersome system covered, even if it was a chore most of the time.