Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Possibility to tweak timescale of the whole Cinemachine.

Discussion in 'Cinemachine' started by bconstantin, Nov 6, 2019.

  1. bconstantin

    bconstantin

    Joined:
    Feb 4, 2019
    Posts:
    15
    Hello,

    Actually there is no timescale tweak in cinemachine. We can just ignore timescale.

    We ship a game and we need to pause it or slow motion it. We don't use global Time.timescale to do this because we have multiple clocks with multiple local timeScale.

    It will be very practical to have a localTimeScale for Cinemachine (in brain, in camera...) we can change and so the deltaTime used by the whole API is affected but not the entire game.

    Is this planned ? How can we achieve this ?
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    6,526
    In fact there is one place in CinemachineBrain that sets the timescale for all of CM. You can hack CinemachineBrain to use a custom value. See CinemachineBrain.GetEffectiveDeltaTime().

    Actually the very latest version of CM (almost in preview) has some secret functionality that does exactly this: CinemachineCore.UniformDeltaTimeOverride, which is checked by CinemachineBrain.GetEffectiveDeltaTime().

    You can either just wait for that release, or hack your own version of it.
     
  3. bconstantin

    bconstantin

    Joined:
    Feb 4, 2019
    Posts:
    15
    Hello,

    Cool I will wait. What's the date for this release ?

    Maybe it will be also cool to set a delta for specific brain and specific virtualCamera ?

    Thank you for the fast answer :)
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    6,526
    It seems to be a pretty unusual usecase. CM uses timescale only for damping, noise, blending, and such things. It's hard to see why anyone would want different values across different parts of CM, and it would be difficult to justify the added complexity. Can you say something about your specific need for this?
     
  5. bconstantin

    bconstantin

    Joined:
    Feb 4, 2019
    Posts:
    15
    Hello,

    In fact we have some "Bullet time" for Tutorial etc. And want to slow down cinemachine behaviour (brain but also virtualCamera damping). Our gameplay can slow down, but we don't touch Time.timescale because some part of the game are UI, some other are Gameplay, some other are just VFX we don't slow down etc....

    Maybe it will be cool to slown down specific camera, say for a GameplayCamera and an other for Menuing.. Reason can be very various.

    For the moment I think CinemachineCore.UniformDeltaTimeOverride will work for us. But maybe someone will also want specific delta. I looked the code, and all functions take a deltaTime, just passing delta*Time.deltaTime would be ok...

    Imagine someone has a Game were some part of the world suffer from time shifting... It will be very pleasant for him to have such great tooling :D
     
    Gregoryl likes this.
  6. Driiade

    Driiade

    Joined:
    Nov 21, 2017
    Posts:
    80
    Coming back (with new account).

    I know a situation where I want to control timeScale on particular virtualCamera.

    For example in our game, we have tutorial which slow motion time, and virtual camera for these tutorials. We want to slow motion Gameplay camera damping, but not tutorial camera ! :)