KAS.KASModulePhysicChild.WaitAndUpdateVelocities C# (CSharp) Method

WaitAndUpdateVelocities() private method

Aligns position, rotation and velocity of the rigidbody.
The update is delayed till the next fixed update to let game's physics to work.
private WaitAndUpdateVelocities ( ) : IEnumerator
return IEnumerator
        IEnumerator WaitAndUpdateVelocities()
        {
            yield return new WaitForFixedUpdate();
            KAS_Shared.SetPartLocalPosRotFrom(
            physicObj.transform, part.transform, currentLocalPos, currentLocalRot);
            if (!physicObjRb.isKinematic) {
              Debug.LogFormat("Set velocity to: {0} | angular velocity: {1}",
                      part.Rigidbody.velocity, part.Rigidbody.angularVelocity);
              physicObjRb.angularVelocity = part.Rigidbody.angularVelocity;
              physicObjRb.velocity = part.Rigidbody.velocity;
            }
        }