Search Unity

Set starting position to current position?

Discussion in 'Timeline' started by msmithUnity, Nov 9, 2018.

  1. msmithUnity

    msmithUnity

    Joined:
    Jun 19, 2015
    Posts:
    12
    I'm creating an animation. I want to move a game object from whatever its current position on the screen is, over to x=100, y=0, z=0. At compile time I obviously don't know it's current position as that can change. When I add the property for the transform position in the animation window though, it sets the starting position of the timeline as 0,0,0. How do I tell it that the starting position is whatever it currently is on the screen when the animation is invoked?

    Thanks
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    A suggestion:

    Set your animation track to use a fixed position
    - in 2018.2 and prior, this requires the animator to not have an animator controller
    - in 2018.3 this is the transform offsets in the Animation Track inspector.

    Then set an ease-in value on your first animation clip on the track. The animated object should blend from their current position to the position of the timeline during the ease-in.
     
  3. msmithUnity

    msmithUnity

    Joined:
    Jun 19, 2015
    Posts:
    12
    Thanks! I have a controller though and since I build critical production software I can't use the beta version (2018.3) yet. So guess I'll hold off on this part of the project for now. Thanks again
     
  4. Jamez0r

    Jamez0r

    Joined:
    Jul 29, 2019
    Posts:
    205
    Sorry to necro this thread, but I have a question about this same topic.

    What I would like to do is have an object move from 'wherever it is when the Timeline is triggered' to a specific point over 2 seconds. I am using the Record feature to set a keyframe for the desired endpoint position of the object 2 seconds into the Timeline.

    When I run the game and start the timeline, it instantly moves the object to the keyframe location that is 2 seconds into the Timeline.

    Is there any way for me to set it up so that the object can smoothly move from 'wherever it currently is' to the desired endpoint location? Again, I'm using the Record option so it isn't an Animation Clip with options for ease-in, etc.

    Thanks for any help!

    Edit: Solved - All I needed to do was convert the Recorded track to an Animation Clip, and then set the Ease-In, like seant mentioned :D
     
    Last edited: Sep 19, 2020