Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question How to record animation of transform's position without it being an offset

Discussion in 'Animation' started by ruiyl, Mar 31, 2021.

  1. ruiyl


    Aug 4, 2019
    I have recorded multiple generic animation clips which animate the transform's position of an object. I can summary them as:
    1. Move from (0,0,0) to (0,0,5).
    2. Move from (0,0,5) to (0,1,5).
    The state machine entry point is animation-1 with a transition from animation-1 to animation-2 that has no exit time or transition duration.

    The problem is when the transition is triggered, the object transform's position should be overridden with (0,0,5) immediately, as the transition duration is zero, and then move to (0,1,5). However, let's say the object position at the trigger time is (0,0,3), the object moves to (0,1,3) instead.

    I am not sure whether the animation is recorded as an offset from the current position or not. If that is true, then how can I record an animation that moves transform's position in global space instead of storing it as an offset? Thank you!