Search Unity

  1. New Unity Live Help updates. Check them out here!

    Dismiss Notice

Anchoring a clip to another

Discussion in 'Timeline' started by remiC3D, Mar 7, 2019.

  1. remiC3D

    remiC3D

    Joined:
    Dec 15, 2017
    Posts:
    20
    Hello,

    I'm currently facing what I thought to be a "common" issue with timelines, I've googled it quite a bit, but I'm surprised I haven't seen any complaint about it, so maybe I'm just bad at searching:

    In a timeline, I would like some of my clips (animation clips, activation clips...) to be "anchored" to one another, that is to say for example start clip B as soon as Clip A ends, so that clip B will automatically change its Start Time if clip A gets shorter or longer later on (due to a manual change in the timeline, or because its original animation clip asset was changed).

    I guess there is no built-in way to achieve this, and I will probably need to write my own custom playable script, but, before I do so, has anyone faced the same issue and found an existing solution / trick / idea ?

    Thanks in advance for your answers !
     
  2. sebastienlh

    sebastienlh

    Unity Technologies

    Joined:
    Sep 22, 2017
    Posts:
    23
    While it's not exactly what you are asking (i.e. anchoring clips), using the Ripple mode to edit your clips might accomplish what you want. The feature was added in 2018.1 so if you're using that version or later, you're good to go.

    It's located at the top, to the left of the time ruler.
    upload_2019-3-7_13-26-8.png


    For more complex scenarios, you may want to consider creating a different Timeline for your anchored clips and driving it from your main Timeline using a Control Track.

    Hope this helps!
     
  3. remiC3D

    remiC3D

    Joined:
    Dec 15, 2017
    Posts:
    20
    Thanks a lot sebastienlh, using Ripple Mode helps a lot indeed, and solves at least 50% of my problematic use cases.
    I'll also try to learn more about Control Tracks, It will probably help me too.
    Thanks again !
     
  4. remiC3D

    remiC3D

    Joined:
    Dec 15, 2017
    Posts:
    20
    Hi Sebastien, I tried to dig into contol tracks, but I find the official documentation a bit scarce about it; Is there a chance you can point out some examples or tutorials on how to use them (even not specificaly related to my issue) ?
     
  5. sebastienlh

    sebastienlh

    Unity Technologies

    Joined:
    Sep 22, 2017
    Posts:
    23
    Hi @remiC3D,

    We don't really have much as far as documentation goes for Control Tracks, but I did dig out a video I made last year about nesting Timelines using Control Tracks.

    Fair warning: This might very well be the most boring video you will ever watch! The absence of audio doesn't help...



    They do more than that like control activation and particles; but this is the use case most relevant to you.

    Hope this helps, otherwise feel free to ask more!
     
  6. remiC3D

    remiC3D

    Joined:
    Dec 15, 2017
    Posts:
    20
    Thank you sebastien.

    I watched your video and I now do hope you can help, because I made a test setup with nested control tracks that is very, very close to yours, and I'm facing an issue:
    I've described that issue in details in this post if you wish, but you could also simply please take a look at the final state of your own master timeline from 1min44 onwards in your video :


    At this stage, if your try to directly "jump" at the end of your master timeline, by clicking, and not dragging, the time slider to the end of the master timeline, like this:

    you will then notice an issue: the blue, red, and green cube will keep their current positions (the one they had before you "jumped"), instead of reaching their expected final position (I.e: being regrouped with the white cube, at the center).

    Can you see what I mean ?

    If so,do you have a solution that would help me?
    In my game the user has a slider that lets him "jump" to various positions of the master timeline, hence I'm facing this issue.

    In the other post, seant_unity suggested a solution that basically consist of turning the shorter embeded timeline (the clip named "Cube - Blue" in your case) into a longer one (the same size as the master timeline), and, of course, it would work, but I would then need to do the same for all and every slave tracks in my master timeline, and, therefore, It would lose all interest in having a master timeline, since it would then not let me precisely control the start and end of each slave timelines...

    Thanks in advance if you can help !
     
  7. sebastienlh

    sebastienlh

    Unity Technologies

    Joined:
    Sep 22, 2017
    Posts:
    23
    We are aware that sub-timelines make timeline non-deterministic and we are trying to find a solution for this but it's not a trivial problem and I don't know when we will have a solution for it.

    In the meantime, what Sean said would work, but I think that if you need random time jumps you should avoid Control Tracks altogether.

    I really wish I had a better answer for you.
     
    remiC3D likes this.
  8. remiC3D

    remiC3D

    Joined:
    Dec 15, 2017
    Posts:
    20
    Thank you, sebastien.

    We'll do as you suggested and avoid using Control Tracks for that usage for now, then.

    Thanks again for your help !
     
  9. Remi_Tribia

    Remi_Tribia

    Joined:
    Apr 29, 2015
    Posts:
    39
    Any news regarding this issue?
     
  10. remiC3D

    remiC3D

    Joined:
    Dec 15, 2017
    Posts:
    20
    As far as I know, no you still can't really anchor a clip to another (not with the built-in tools at least), and using control tracks as a workaround will still give you a non-deterministic behavior if the main timeline is not read in a linear way.
     
unityunity