Search Unity

When in unity frame lifecycle are rigidbodies moved to depenetrate?

Discussion in 'Physics' started by Ewanuk, Jan 19, 2022.

  1. Ewanuk

    Ewanuk

    Joined:
    Jul 9, 2011
    Posts:
    257
    We have a kinematic rigidbody w/ a 3D collider in the scene. Then we instantiate another one on top of it. At some point after instantiation one of the bodies will be moved so they no longer depenetrate. When in the unity event cycle does this occur?
    https://docs.unity3d.com/Manual/ExecutionOrder.html

    Thanks
     
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,478
    During the simulation step where everything is done physics related. When does the physics step happen? By default, immediately after all the FixedUpdate script callbacks. You can though, turn-off auto-simulation and manually simulate it yourself whenever you like so it'd happen then.

    In short, as part of the the simulation step (solver stage) alongside things like physics callbacks etc.
     
    Ewanuk likes this.