Search Unity

Question event function between FixedUpdates

Discussion in 'Physics' started by StCost, Oct 22, 2021.

  1. StCost

    StCost

    Joined:
    Mar 1, 2017
    Posts:
    30
    I have 0.022222ms fixed time stamp.
    Sometimes I make a lot of physics operations, which takes 1ms for calculations.
    Would be good to performs these actions in between fixed updates. In profiler I can clearly see free space just begging to be used.

    Question is: how can I do something perfectly between FixedUpdates?

    upload_2021-10-22_16-46-57.png

    EDIT: I think I did something similar by adding this into coroutine:

    yield return new WaitForFixedUpdate();
    yield return new WaitForEndOfFrame();
    yield return new WaitForEndOfFrame();


    But I'm not sure it's exactly correct. In case it's important - game is for VR so target FPS is 90. Twice the amount of fixed time stamp
     
    Last edited: Oct 22, 2021