Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Reversing Animations

Discussion in 'Animation' started by MaffuK, Jun 16, 2014.

  1. MaffuK

    MaffuK

    Joined:
    May 21, 2014
    Posts:
    4
    Hi,

    I've got a question which may well have a very easy answer, but I can't figure it out.

    Say I have a filing cabinet, and each draw has an animation to open, and an object is revealed. These animations are tied to buttons on a GUI which open each draw individually. What I would like to be able to do is to click the button, the animation plays, and when I click on a different button the animation is reversed, and the next is played.

    Currently the animations play, but they arent reversed, so all the drawers end up out. When I click the button again, the animation repeats itself.

    On the unity help documentation it points towards: "transform.animation.Rewind(Animation)" which doesn't seem to work.

    The animation is one long animation which is split into 4 clips in Unity, is this preventing the animation being reversed?


    Thanks, Matt.
     
  2. Mecanim-Dev

    Mecanim-Dev

    Unity Technologies

    Joined:
    Nov 26, 2012
    Posts:
    1,675
    Hi Matt

    are you using the Animation Component(legacy) or the Animator Component(mecanim)?
     
  3. MaffuK

    MaffuK

    Joined:
    May 21, 2014
    Posts:
    4
    Hi, i've done the animations in 3DS max in a single scene, and I am directing Unity to the frames of each animation.

    For example each clip is the animation of a cabinet draw opening, and rather than animating it closing manually I hoped that Unity could reverse it.