Search Unity

how can i get an animated timeline object's position at the start of the anim?

Discussion in 'Timeline' started by Ross_S, Mar 6, 2018.

  1. Ross_S

    Ross_S

    Joined:
    Jul 10, 2012
    Posts:
    29
    Hi,

    so, currently when animating the position of a character with Timeline - I'm animating in real world space and if i start from x,y 10,10 then everytime i play that Timeline - the character will be reset to start from that position. What i would like is that if the player happens to be at 20,20 then the timeline positional anim will start from there.
    I know i can do this with applying track offsets. What I'm trying to do is fill in those offsets automatically by finding the difference in position between the start frame of the timeline animation and the current character position.
    So... What I'm wondering - how can i get an animated timeline object's position at the start of the anim? without playing it etc... i want to do this before the timeline is played.
    I've seen this which gets the tracks from timeline for me.
    https://forum.unity.com/threads/modify-animation-track-offsets-during-runtime.485370/
    I'm just not sure then how to get the object's position at frame 1.
    Thanks!
     
  2. Cover-Club-Media

    Cover-Club-Media

    Joined:
    Apr 30, 2015
    Posts:
    54
    I'm searching for the very same issue, I don't think it's possible so far and the question has been asked many times. So far I'm getting that timeline is almost unusable for player characters in which the location is different.

    Hopefully, I'm wrong but a long search has only led me to what you pointed out which didn't work.