I am trying to detach a child object while changing to another animation state, here is my code
myAnimator.SetBool("ToRunAnim", true);
childObject.transform.parent = null;
myAnimator.Rebind();
Of course, by doing that, what happen is the animator will reset back to the default animation state, and all animator parameter also get reset too. However, it is very undesirable since I loss my whole animation state in order to just detach a child from the animation. Is there any way to save the whole animator state or better way to detach a child from the animation without loss the whole animation state? The only way I can think of so far is actually hide the child object and spawn another object with the same transform which simulate the child, but in some situation, this approach is not possible, is there any better way to tackle this problem?