Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Cross-scene workflow?

Discussion in 'Timeline' started by oxysofts, Feb 21, 2020.

  1. oxysofts

    oxysofts

    Joined:
    Dec 17, 2015
    Posts:
    72
    It seems that Timelines can support references between multiple scenes just fine at runtime if you manually inject the references/bindings. However if you bind objects or components in other scenes, they will be lost when the timeline is re-opened for editing at a later time.

    Specific use-case: we use Cinemachine in our project. We have a global scene in the game which is active at all time, and contains the CinemachineBrain. We would like to use timelines for making cutscenes in our game, however cinemachine tracks in timeline require a binding to the brain which is in a global scene. As said before, we can inject the CinemachineTrack at runtime and it works just fine, however the workflow is quite a pain because we have to re-assign the binding each time we want to work on this cutscene.

    What is the recommended approach here? Do we absolutely need to create a new Camera and CinemachineBrain for every scene that will have cutscenes in it?
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,309
    There are a few different approaches, depending on your use case. In your case, it seems that a reasonable approach would be to simply bind the existing brain/cameras to the timeline when the playable director loads, possibly using a naming scheme on the tracks and clips to direct the binding.
     
    ROBYER1 likes this.
  3. oxysofts

    oxysofts

    Joined:
    Dec 17, 2015
    Posts:
    72
    Yes, but as I said it's not ideal when working on the timeline in edit mode because we then have to re-assign the brain manually each time. Is there a solution to this?
     
  4. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,309
    ROBYER1 likes this.
  5. olejuer

    olejuer

    Joined:
    Dec 1, 2014
    Posts:
    129
    @oxysofts have you considered an editor utility that does the same thing as your code that assigns the binding at runtime? As long as you have your cinemachine scene loaded, the binding could be established at the press of a button or maybe even fully automatically in the editor.

    It would be nice to have access to the track assets through the editor, though. Currently, they can only be discovered through code and custom utility has to be written. I think assigning bindings to tracks at runtime is a pretty powerful mechanic. This could also be an instance of a prefab that is created at runtime. It would be much simpler to handle with easier access to the track assets.
     
unityunity