Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. We're looking for your feedback on the platforms you use and how you use them. Let us know!
    Dismiss Notice
  4. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  6. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  7. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  8. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Animation reversal

Discussion in 'Animation' started by kdarius43, Aug 8, 2018.

  1. kdarius43

    kdarius43

    Joined:
    Mar 16, 2015
    Posts:
    136
    Hello all I have had this issue that has been bothering me. I can hard code it and fix the problem but wanted to see if there was an easier ways. Say i have a cube that i have and animator on and and an animation. This animation goes from 0 - 100 in scale. I have another animation attached to the cube that goes from scale 100 - 0. When the cube is clicked it sends trigger to the animator to play the opposite animation. The issue i have is if the cube is animating from 0 - 100 and it is at 63 and someone clicks it again the other animation is triggered. The issue with this is instead of it going from 63 - 0 it just instantly to 100 and start going back to zero. I was wondering if there was a way to fix this in animator and animations and not have to code it in.
     
  2. TantzyGames

    TantzyGames

    Joined:
    Jul 27, 2016
    Posts:
    39
    Try using transitions instead of animation clips.
    1. Create one clip of the cube at 0, and one clip of the cube at 100.
    2. Create a transition to each clip from "Any State".
    3. Set a parameter to trigger each transition.

    Something this simple would probably be much simpler just to use lerp in a script, but this method could be useful for more complex animations.