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

Question Character Objects Physics does not update till frames later...

Discussion in 'Physics' started by jranellstein, Aug 10, 2022.

  1. jranellstein

    jranellstein

    Joined:
    Aug 10, 2022
    Posts:
    2
    Hi, I'm currently working on a capstone project and am trying to finalize a generic humanoids movement and physics. All of the physics are run on a kinematic environment, with every single object being kinematic as well. I have hardcoded all of my characters physics into the scripts, including jumping, walking, running, etc. The physics themselves are functioning as they should, my problem is when an action is called, the physics don't update until frames later. As demonstrated in the gif I posted, whenever I input a jump for my character, the animation starts on frame 1, but the physics don't kick in until a little after the animation begins. The same can be seen when my character collides with the ground, when the two collide, the landing animation does occur but once again, the physics don't kick in until a little after, giving the illusion that I've fallen through the ground before the game corrects the characters position. Any fixes or tips would be most appreciated!
     

    Attached Files:

  2. knobblez

    knobblez

    Joined:
    Nov 26, 2017
    Posts:
    223
    You are able to adjust how often the physics calculations are updated.

    Project Settings > Time > Fixed Timestep

    Idk how hard this hits performance so I wouldn't go crazy with it haha.
     
  3. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    10,529