Search Unity

Bug IK constrain offset

Discussion in 'Animation' started by teatime_penguin, Jan 20, 2023.

  1. teatime_penguin

    teatime_penguin

    Joined:
    May 3, 2022
    Posts:
    25
    i have found that based on the position of the spines in humanoid character the hands have an offset. any suggestions on what I'm doing wrong/if this is happing to other people.
     
    Last edited: Jan 20, 2023
  2. Kreshi

    Kreshi

    Joined:
    Jan 12, 2015
    Posts:
    446
    It depends at which time you read the hands position. If you read it from LateUpdate, the position that you get should be the correct one (from the top of my head).
     
  3. teatime_penguin

    teatime_penguin

    Joined:
    May 3, 2022
    Posts:
    25
    i am using the ik constraint to read the hand pos.
     
  4. teatime_penguin

    teatime_penguin

    Joined:
    May 3, 2022
    Posts:
    25
    handpos1.png handpos2.png
    Photo of problems, the only thing changed is the head position. the red sphere is the target and the hand changes based on the position of the highest black sphere.
     
    Last edited: Jan 24, 2023
  5. Kreshi

    Kreshi

    Joined:
    Jan 12, 2015
    Posts:
    446
    I can't follow based on these 2 images.
    With LateUpdate I mean the timing to read at not the variable to read from ^^.

    With anything you do in LateUpdate you have the highest probability that no other script overrides any position afterwards :).
     
  6. teatime_penguin

    teatime_penguin

    Joined:
    May 3, 2022
    Posts:
    25
    i don't understand, i don't use a script to move the hand i use a 2 bone ik constraint from the animation package with the red sphere as the target.
     
  7. Kreshi

    Kreshi

    Joined:
    Jan 12, 2015
    Posts:
    446
    I see.
    Do you change your spine rotation in another script?
    I ask this because Animation Rigging is executed BEFORE your custom scripts are.
    This means, if you use Animation Rigging to grab something and rotate the spine afterwards in one of your custom scripts, the character will fail grabbing the object correctly.