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

Bug [Oculus Quest 2] A lot of physics ticks per frame

Discussion in 'Physics' started by unity_B159A46BF5F15B9376DA, Mar 27, 2023.

  1. unity_B159A46BF5F15B9376DA

    unity_B159A46BF5F15B9376DA

    Joined:
    Mar 6, 2023
    Posts:
    7
    Unity 2020.3.46f1

    Recording a profiler to a file while playing I see sometimes a lot of physics ticks per frame.

    Time Manager settings:
    Fixed Timestep: 0.013888889
    Maximum Allowed Timestep: 0.2

    upload_2023-3-27_13-11-53.png

    Fast render before and after.

    upload_2023-3-27_13-13-47.png


    What happen?
    How i can fix that?

    I can let you more information if you ask
     
  2. unity_B159A46BF5F15B9376DA

    unity_B159A46BF5F15B9376DA

    Joined:
    Mar 6, 2023
    Posts:
    7
  3. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,971
    Is the issue maybe coming from something else?
    If the GPU is loaded for this time physics will keep ticking while it's trying to render.
    The framerate seems stable otherwise
     
  4. unity_B159A46BF5F15B9376DA

    unity_B159A46BF5F15B9376DA

    Joined:
    Mar 6, 2023
    Posts:
    7

    But this does not happen in other frames.

    At some 'random time'
    I can't specifically reproduce the bug
     
  5. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,971
    Enable deep profiling maybe
     
  6. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,321
    You're calling it "physics ticks" but you mean FixedUpdate. Physics doesn't control this, Physics is called by the FixedUpdate as are other systems including rhe scripts as you can see in your profiler image. It'll be called more often if something is spending too much time per-frame i.e. it's trying to catch-up with game time.

    It's entirely possible to end up with FixedUpdate and therefore physics, scripts etc being called 97 times but that doesn't mean physics is causing it.

    The only realistic way to find this is to use the profiler in the hope of finding it and/or disabling scripts from running in the hope to narrow down the root cause.

    I will say that 97 fixed-update calls is very suspicious if your fixed-update time is 60-70Hz, That means something causes over a second delay which is clearly a lot!

    It would seem that this should be relative easy to spot this in a profile recording but I appreciate more complex projects are not always easy but that really is where disabling things can help.
     
  7. unity_B159A46BF5F15B9376DA

    unity_B159A46BF5F15B9376DA

    Joined:
    Mar 6, 2023
    Posts:
    7
    thanks for your reply

    I will try to look for the problem by disabling objects

    But the main problem is that it can't be reproduced.
    With the same launch of the game, this bug is either repeated or not.

    And most importantly, judging by the profiler, neither in the frame BEFORE, nor in the frame AFTER, nor in the current frame, there are no long-term operations.