Search Unity

Dynamic Animation Generation

Discussion in 'Animation' started by classofthirteenth, Nov 1, 2019.

  1. classofthirteenth

    classofthirteenth

    Joined:
    Nov 1, 2019
    Posts:
    16
    Hello everyone,

    I have a project that will generate a sequence of animation which is a sign language gesture based on the input text from the user. I already figured how to use mecanim but it will be difficult if I have a bunch of gestures animation to be generated.

    Since I'm new on unity, I want to ask is it possible to create a dynamic animation generation via scripts? If that's possible are there any resources or courses in order to learn that?

    The scenario is: whenever the input field of text is entered, the application will generate the animation based on the text

    Example input: hello there
    then the output will be the gesture animation of "hello" and "there" sequentially

    I already created a script to deconstruct the text input into "hello" and "there" but have difficulty in mapping them to their associate gestures animation. All the animation clip are stored in .fbx format

    Thank you
     
  2. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,568
    If I'm understanding you correctly, you don't actually want to generate animations dynamically, you have already made the animations and just need to be able to associate each one with a word so you can pick which one to play once you determine the word that was entered.

    If that's the case, then Animancer would probably be very helpful to you (link in my signature). If you name each clip using the exact word it represents, you could use a NamedAnimancerComponent and simply assign all your clips to its Animations array in the Inspector, then just call Play("word") to play the animation for that word. The Basics/Named Animations example explains it in a lot more detail.
     
    classofthirteenth likes this.
  3. classofthirteenth

    classofthirteenth

    Joined:
    Nov 1, 2019
    Posts:
    16
    Wow, that's exactly what I wanted to achieve!! Thank you for the recommendation, I'll try it immediately

    EDIT : I have read the documentation from Animancer, one thing that seems missing from my understanding is it possible to determine the number of animation clips and the assets via scripts with loops? In the documentation, it shows that we have to predetermine the number of animation clips via the unity editor. Anyway, thank you, your plugin is really awesome!
     
    Last edited: Nov 4, 2019