KAS.KASModulePhysicChild.WaitAndPromoteToPhysic C# (CSharp) Method

WaitAndPromoteToPhysic() private method

Turns rigidbody to a physics object.
The update is delayed till the next fixed update to let game's physics to work. Once updated the physical object is guaranteed to be detached from the parent.
private WaitAndPromoteToPhysic ( ) : IEnumerator
return IEnumerator
        IEnumerator WaitAndPromoteToPhysic()
        {
            yield return new WaitForFixedUpdate();
            Debug.LogFormat("Delayed set velocity to: {0} | angular velocity: {1}",
                    part.Rigidbody.velocity, part.Rigidbody.angularVelocity);
            physicObjRb.angularVelocity = part.Rigidbody.angularVelocity;
            physicObjRb.velocity = part.Rigidbody.velocity;
            physicObjRb.isKinematic = false;
            physicObj.transform.parent = null;
        }