Search Unity

Impulse's Unscaled Decay time?

Discussion in 'Cinemachine' started by LezCT, Aug 27, 2019.

  1. LezCT

    LezCT

    Joined:
    Nov 15, 2014
    Posts:
    55
    It's nice that we can set the actual shake in unscaled time, but I've noticed that the decay time is not running on unscaled time that causes the screen to shake too much on-screen or the decay time's really slow when the time scale is low. We can just adjust the decay's transition curve sure, but how about the normal timescale?
    I also cannot find a setting to set its transition time to unscaled one, can someone point me at the right setting to adjust?
     
  2. LezCT

    LezCT

    Joined:
    Nov 15, 2014
    Posts:
    55
    Anyone? Let me explain it further with an example:
    check the CM brain's "unscaled time" bool
    then shake the camera at timescale = .125
    the impulse's shake speed remains normal in slow motion.
    but the impulse's decay transition is also slow in slow motion.
     
  3. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    Try CinemachineImpulseManager.Instance.IgnoreTimeScale = true.
    Note that this is a new feature in Impulse, and is only available in the most recent CM release (available in preview).
     
    YagoRG and LezCT like this.
  4. LezCT

    LezCT

    Joined:
    Nov 15, 2014
    Posts:
    55
    Awesome, thank you very much!
     
    Gregoryl likes this.
  5. Macionik

    Macionik

    Joined:
    Apr 7, 2017
    Posts:
    2
    And is there any way to make decay's transition unscaled time? I've been looking and found nothing.
     
  6. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    Setting
    CinemachineImpulseManager.Instance.IgnoreTimeScale = true
    handles impulse decay also.
     
    LezCT likes this.
  7. RemiOuterminds

    RemiOuterminds

    Joined:
    Mar 23, 2017
    Posts:
    10
    Hi, I'm on 2.6.5 and I have a related issue.

    Currently, when CinemachineImpulseManager's ignoreTimeScale is set to false, when I set Unity's timeScale to 0, the camera shake will continue indefinitely while the game is "paused".

    I am wrong to expect setting the timeScale to 0 would pause the camera shake?
    cameraImpulse.gif
     
  8. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    @RemiOuterminds Can you show the inspector for the impulse listener and for the impulse source?
     
  9. RemiOuterminds

    RemiOuterminds

    Joined:
    Mar 23, 2017
    Posts:
    10
    Yes, of course.
    The Impulse Source is on my main character, and the Impulse Listener is on my Virtual Cameras

    CinemachineBug2.png
     
  10. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    Thanks. It looks good.

    When CinemachineImpulseManager.IgnoreTimescale == false, then the impulse time comes from CinemachineCore.CurrentTime, which defers to Time.time unless CinemachineCore.CurrentTimeOverride >= 0.

    Do you have CinemachineCore.CurrentTimeOverride set to something non-negative?
     
  11. RemiOuterminds

    RemiOuterminds

    Joined:
    Mar 23, 2017
    Posts:
    10
    No, it is set to -1
     
  12. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    In that case, when the timescale is zero, your impulses should stop. Are you sure that the camera movement is coming from Impulse?
     
  13. RemiOuterminds

    RemiOuterminds

    Joined:
    Mar 23, 2017
    Posts:
    10
    Yes, it is coming from impulseSource.GenerateImpulse() (i've tried multiple variants of this function).
    I've outputed the CurrentTimeOverride, and CurrentTime from Cinemachine.
    I can see that CurrentTime remains stable and override stays at -1, yet the camera continues to shake.
     
  14. RemiOuterminds

    RemiOuterminds

    Joined:
    Mar 23, 2017
    Posts:
    10
    I've managed to replicate the issue in a very simple test project. Should I submit a bug report for this, with the sample project? Or can I post it directly here?

    cameraImpulsePaused.gif
     
    Last edited: Apr 19, 2021
  15. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    Sorry for the delayed response. Yes please, submit a bug report with the project. That is the best way to ensure that the issue gets tracked and dealt with properly. Many thanks for preparing this.
     
    RemiOuterminds likes this.