Search Unity

Question How to match clip offsets from code?

Discussion in 'Animation' started by vonSchlank, Aug 13, 2021.

  1. vonSchlank

    vonSchlank

    Joined:
    Jan 5, 2017
    Posts:
    36
    When i'm in the editor, i can right click on an animation clip on the Timeline, and Match Offsets to Previous Clip. How can i do that runtime, from code?
     
  2. yale3d

    yale3d

    Joined:
    Oct 12, 2018
    Posts:
    16
    More than a half year was not enough to answer this question. How embarrassing...
     
  3. friuns3

    friuns3

    Joined:
    Oct 30, 2009
    Posts:
    307
    nobody knows...
     
  4. friuns3

    friuns3

    Joined:
    Oct 30, 2009
    Posts:
    307
    Actually found solution you need to make Timeline package editable, then move TimelineAnimationUtilities.cs from Editor folder outside and then you can access TimelineAnimationUtilities.MatchPrevious from runtime

    good some parts of unity are open source
     
    yale3d likes this.
  5. yale3d

    yale3d

    Joined:
    Oct 12, 2018
    Posts:
    16
    Thanks, i'll give it a try!