Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Blending between timelines or controlling current playback from script for talkshow scene

Discussion in 'Timeline' started by Xarbrough, Aug 20, 2017.

  1. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    537
    I have a game sequence which works similar to one of those cheap talkshows on TV. There are a few characters on screen and the player can talk to each of them by clicking. When nobody is selected, there's a default camera view and when talking I have different cinemachine cameras set up.

    I'd like to blend between all of my shots and also animate some lights and extras, but now I'm unsure what a good way to manage this would be.

    My first attempt is making a timeline for each conversation and activating them from script. But in that case I would have to make sure that each in and out of the sequences starts and ends on my default camera position, which is not as nice as I assume it could be.

    Is there a better approach? Maybe some sort of blending between timelines and controlling the playback from script? Or can I just play a timeline and have some default blending from the last cinemachine camera?
     
    Last edited: May 27, 2019
  2. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    371
    If you're using Cinemachine for your cameras, then it wouldn't matter? Swapping timelines would update the Cinemachine brain which would blend from the current pos to the latest active virtual camera?
     
    Xarbrough likes this.
  3. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    537
    Right, I noticed, that it makes more sense to just turn CM cameras off and on from timeline to control them. At first I went with the blending clips within timeline, because I thought it was easier to control the transition, but it turned out to not work, when using multiple timelines, instead I just turn them on and off and use the CM blends.

    I'm still unhappy with my solution for blending between timelines. In my case I've set them up so that each timeline represents a "scene setup" with a different camera position and lighting adjustments. I modified the default Playables LightControl to blend light intensity smoothly, but it still means that in every timline I have to create a clip or every light and tell it to blend to a target value by using the fade in value. So basically I still have code that does:

    - Timeline starts, don't modify any existing values of controlled lights
    - Now run and blend each light towards the set target
    - At the end, hold the current timeline, then disable it, keep the light values

    This works, but it would be easier if I could have multiple timelines within a master timeline and just define each sub-timeline like a state (light A = 1.4 etc) and then use the clip blending on the timelines to fade between them. Currently, if I want to modify a transition I have to open at least two timelines and adjust the fade in on every affected object.
     
  4. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    4,577
    Isn't that what playable are for? Even though I'm still trying to grasp their implementation.
     
    GameDevCouple_I likes this.
  5. scotih

    scotih

    Joined:
    May 1, 2018
    Posts:
    2
    I've also found that the best (not great) way to handle blending between multiple timelines is to manually control the camera via script. If you use Cinemachine tracks, it turns off the default blending, so you get hard transitions between cameras.

    There should be a better way built-in. I'm sure it will improve with time.
     
  6. GameDevCouple_I

    GameDevCouple_I

    Joined:
    Oct 5, 2013
    Posts:
    2,126
    @seant_unity can you explain how you would blend from one timeline being in control to another, rather than from timeline to animator in control?