Search Unity

Bug Time bug

Discussion in 'Scripting' started by Hoya127, Mar 9, 2022.

  1. Hoya127

    Hoya127

    Joined:
    Dec 18, 2021
    Posts:
    34
    Time problems arise when the network fluctuates.

    Problems occur intermittently when Wifi is activated.

    The following is the code I wrote for checking.
    private void LateUpdate()
    {
    float deltaTime = Time.unscaledDeltaTime;
    if (deltaTime == 0)
    {
    Debug.Log(string.Format(" _Error 1000 ----Nan {0} {1} {2} {6} // {3} {4} {5} {7}", deltaTime, Time.time, Time.deltaTime, fff1, fff2, fff3, Time.timeScale, fff4));
    }
    fff1 = Time.time;
    fff2 = Time.deltaTime;
    fff3 = Time.unscaledDeltaTime;
    fff4 = Time.timeScale;
    }
    --------------------------------------------------------------------

    _Error 1000 ----Nan 0 74.39186 1E-05 1 // 74.39185 0.08338057 0.08338057 1

    -----------------------------------------------------------------------------------------------------------------------
    When this case occurs, if you move the scroll with a UI event, it seems as if all the scrolling contents have disappeared intermittently.

    Is this a Unity specific version issue?

    Or is there some other reason?

    The version I use is 2021.1.27f1 .

    Seeking advice from people with similar experiences.

    Thank you.
     
  2. LB_Chris

    LB_Chris

    Joined:
    Jan 29, 2020
    Posts:
    33
    Hey,

    we have the same issue with Time.unscaledDeltaTime being 0 and Time.deltaTime being 0.00001 (1E-05). Have you found anything useful yet?

    Here are some information we have gathered, maybe they are of use for you:
    We encounter this bug only in our Oculus Quest build and not on our PCs on the Oculus Rift (in Unity play mode). Network has nothing to with the issue in our case. The "error frame" occurs inconsistently, sometimes multiple times per second, sometimes it doesn't show for multiple seconds. We are using the Unity version LTS 2021.3.0f1.

    It feels like the error frame is an empty frame in which unity does basically nothing. We cannot say if it renders or not, but considering most of the stuff (at least most of our code etc) depends on Time.deltaTime, pretty much nothing of interest will happen in that frame.

    If you have any more information to share, we would appreciate it. Maybe we can find out this bug in coorperation.
     
  3. d4forevr

    d4forevr

    Joined:
    May 12, 2021
    Posts:
    1