Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Is there any way to force a fixed update?

Discussion in 'Physics' started by testure, Dec 2, 2014.

  1. testure


    Jul 3, 2011
    Without getting into too much detail, I'm working on a client/server multilayer game and im rolling my own reliable UDP network code. Right now I'm hung up on getting client side prediction for physics working the way I've seen it done in other engines because there doesn't seem to be a way to force FixedUpdate to happen on the current frame.

    Example scenario:

    1. Client bumps into a box locally, box reacts with physics.

    2. Server is authoritative, so it says "no, you had latency- somebody knocked the box out of your path and you missed . Here is the new transform, velocity, etc"

    3. Client gets new values for the box and forces a fixed update so the physics simulation plays correctly on the client machine.

    So in my situation, I can't force a fixed update so the simulation continues with bad data until the next fixed update, which causes worse jittery/jumpy behavior since the clisn't is that much further behind the server by the time a fixed update happens.

    Anybody have any suggestions on where to go from here?
  2. SpeakUpGames


    Nov 25, 2014
  3. hippocoder


    Digital Ape Moderator

    Apr 11, 2010
    Have you tried deferring changes and then applying network changes at the start of fixedupdate?