Search Unity

Question Playing animation then reversing doesn't return to the same position

Discussion in 'Animation' started by BrainwareLLC, Jan 13, 2021.

  1. BrainwareLLC

    BrainwareLLC

    Joined:
    May 4, 2020
    Posts:
    3
    I'm trying to play an animation on a bot that picks up an object and returns to the starting position. So, I added a Pickup clip, then I add same clip but with a speed of -1.0 (Unpickup). But, when I transition from Idle > Pickup > Unpickup > Idle the bot moves slightly. The transitions are:

    Exit Time OFF, Transition Duration 0.25s
    Exit Time ON, Transition Duration 0.0
    Exit Time ON, Transition Duration 0.25s​

    Exit Time is off on the first transition because this could happen any time during the Idle animation. So, I don't want to wait for the Idle animation to complete. In the Idle animation, the bot stands still and looks around so there isn't much position changes.

    I use a Trigger to start this and add that as a condition of the first transition.

    The Pickup clip animation is rock solid. There is NO feet movement. However, the Idle animation does have some small feet movement. Could this be the source of the position offset? If so, why? Is it because the animation returned to the beginning of the Idle clip which might have a different Root.T? If so, how can I get the animation to return to the place in the Idle animation where it left off? Should I record the Idle time offset when the animation started and programmatically set the offset in the last transition?
     
    Last edited: Jan 13, 2021