Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Feedback CinemachineCore.UpdateVirtualCamera may inappropriate called in SmartUpdate

Discussion in 'Cinemachine' started by AbLee1992, Jun 1, 2019.

  1. AbLee1992

    AbLee1992

    Joined:
    Jun 1, 2019
    Posts:
    2
    When setting CinemachineBrain.UpdateMethod = SmartUpdate, CinemachineCore.UpdateVirtualCamera maybe called more than once with the same Time.frameCount, sequence is like:
    1. FixedUpdate: during this update, the vcam's status.lastUpdateFrame is set to Time.frameCount, status.lastUpdateFixedFrame = FixedFrameCount, status.lastUpdateMode = Fixed;
    2. LateUpdate: in this update frameDelta is 0, in version 2.3.4, it will continue on vcam.InternalUpdateCameraState with deltaTime equals Time.deltaTime. In version 2.2.8, the deltaTime will be -1 cause frameDelta is 0, not equals 1;

    In step 2, is it more suitable that deltaTime equals: Time.time - {FixedUpdate complete time}.
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,658
    Thank you for this. It may well be a regression. Looking into it.