Search Unity

How do we animate Visual Elements?

Discussion in 'UI Toolkit' started by Claytonious, Jun 9, 2020.

  1. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    904
    How do we animate visual elements? I've seen threads like this one which reference a ValueAnimation class. Is there any documentation about how to use this anywhere?

    We're using the 0.0.4 preview of runtime and are focused only on runtime use cases.

    Thanks for any info!
     
    Last edited: Jun 10, 2020
  2. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    904
    I've ended writing constructs like this:
    Code (CSharp):
    1.            
    2. button.experimental.animation.Start(25f, 200f, 300, (b, val) =>
    3. {
    4.     b.style.height = val;
    5. }).Ease(Easing.OutBounce);
    6.  
    Is that kind of imperative scripting from C# the current best way to accomplish animation of visual elements? Is anything similar possible from within the UXML itself at the moment and/or from the UI Builder? I'm wondering how to expose these things to artists.

    Thanks!
     
    NyraSaphira, JoshDW, bugbeeb and 2 others like this.
  3. sebastiend-unity

    sebastiend-unity

    Unity Technologies

    Joined:
    Nov 9, 2015
    Posts:
    184
    Hi,

    Thanks for your question. We do plan to have animation authoring tools as part of our future (UI Builder) roadmap. Currently however what you described is the best way to do UITK-based UI animation.

    Sebastien
     
  4. xpxilom

    xpxilom

    Joined:
    Aug 28, 2014
    Posts:
    30
    [QUOTE = "sebastiend-unity, publicación: 5964518, miembro: 980243"] Hola,

    Gracias por tu pregunta Planeamos tener herramientas de creación de animaciones como parte de nuestra hoja de ruta futura (UI Builder). Actualmente, sin embargo, lo que describió es la mejor manera de hacer animaciones de IU basadas en UITK.

    Sebastien [/ QUOTE]
    no ready yet?
     
  5. JoshDW

    JoshDW

    Joined:
    Jun 8, 2020
    Posts:
    1
    Hello @sebastiend-unity , is there any update on this thread?

    With UIToolkit now in the LTS release for 2021, I'm hopefully that there's a relatively easy way to animate my UI Builder elements. Particularly fade-ins/outs when the Scenes load.
     
  6. Xan_9

    Xan_9

    Joined:
    Oct 7, 2020
    Posts:
    31
  7. RunninglVlan

    RunninglVlan

    Joined:
    Nov 6, 2018
    Posts:
    182
    I know about transitions, but is it currently possible to do following animations in UITK?
    upload_2022-9-23_23-3-4.gif
     
  8. patrickjarnfelt

    patrickjarnfelt

    Joined:
    Jun 24, 2013
    Posts:
    28
    You can achieve shakes like this by adding and removing "left" "right" rotation classes to an element that has a transition property/duration set at correct intervals via code. That's how I am doing it.
    Unity is working on giving us timeline animation options in UI Toolkit. When it's ready is anyone's guess.
     
    RunninglVlan likes this.