Search Unity

How to resolve track target that are cross-scene references ?

Discussion in 'Timeline' started by Kiupe, Aug 30, 2017.

  1. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    523
    Hi guys,

    In the editor you can work on multiple scene at the same time. So, if I create a Timeline in scene_A I can create a track and reference an object in scene_B. At runtime I will have to load scene_A and then load additively scene_B. I'm pretty sure the Timeline in scene_A will have lost all scene_B references. Is there a way to resolve that at runtime ?

    Thanks
     
  2. thierry_unity

    thierry_unity

    Unity Technologies

    Joined:
    Jun 10, 2015
    Posts:
    178
    Hi,
    As mention in another thread, Multi-scene isn't supported by Timeline yet but it's something we have in mind for the future.
     
  3. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    523
    Ok. It would be very useful.

    So, how would you manage Timeline that should "happened" in different places/scenes ? I dont' really get it right now. It's like having a long cinematiq with differents characters and places and I'd like to compose the scenario inside one timeline.

    Thanks
     
  4. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    343
    What we're doing is editing and setting up timelines with the multiscene editing, and then on the master timeline we have a custom script that is replacing the bindings when all the scenes have loaded at play time (also with an editor menu option to replace at edit time).
     
  5. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    523
    @Carwashh how do you do ? I mean, what information do you store in your custom script to be able to identifiy and retrieve track target which are in other scenes ?
     
  6. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    343
    I can't give you the code, it's from work and I didn't write it, but the gist of it is:

    string for the track name.
    string for the object name.
    Get the playabledirector component, check it's outputs, if the output matches the track name... bind the object to it.
     
  7. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    523
    Ok, got it. I have almost no experience with Timeline, I wasn't sure it would be possible to retrieve track names nor track targets.

    Thanks for the tips, I think it's a good way to deal with that issue until Unity give us a built-in one :)