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 Issues While De Parenting it.

Discussion in 'Scripting' started by NarutoU21, Oct 6, 2023 at 8:44 AM.

  1. NarutoU21

    NarutoU21

    Joined:
    Sep 27, 2020
    Posts:
    12
    Well i am experiencing issues while de parenting the child after making its parent. i have a humanoid body and while animating i assign a point on its right foot. by making the point child to that right foot. i stop animation in middle and then unparent the point which was exactly moving along the right foot. After un parenting it changes the position of the point.


    point moving with right foot
    Code.PNG MovingWithFoot.PNG Changed.PNG

    after unparenting the right foot

    here how its changed the position .

    Any Solutions?
     
    Last edited: Oct 6, 2023 at 9:01 AM
  2. zulo3d

    zulo3d

    Joined:
    Feb 18, 2023
    Posts:
    421
    Code (CSharp):
    1.    RightLegPoint.transform.SetParent(mainIK.references.rightFoot);
    2.    RightLegPoint.transform.localPosition=Vector3.zero;
    3.    yield return new WaitForSeconds(1f);
    4.    RightLegPoint.transform.SetParent(null,true);
     
  3. NarutoU21

    NarutoU21

    Joined:
    Sep 27, 2020
    Posts:
    12

    Well i have tried that too same results
     
  4. NarutoU21

    NarutoU21

    Joined:
    Sep 27, 2020
    Posts:
    12
    Well issue is resolved. because Final IK component it fixes the position.