Animation/IK glitch when cancelling IK?

DankP3

Active member
So, I am experiencing an animation glitch when cancelling IK and wondered if you had any ideas on where to look.
My ability is concurrent and not cancelling (same ability controls both hands so you can see that the ability remains active as one hand can still be IK tracking - if the ability were to stop it would cancel all IKs).

The IK is run through UCC, it is turned on thus:
m_CharacterIK.SetAbilityIKTarget(m_RightHandIKTarget, CharacterIKBase.IKGoal.RightHand, 0.4f);

and turned off:
m_CharacterIK.SetAbilityIKTarget(null, CharacterIKBase.IKGoal.RightHand, 0.4f);

You can see in the video when the IK is triggered by the hand movements start, but if you observe the hands/arms after they have finished cancelling you will see obvious reset twitches, almost like the IK is not blending out correctly and then moving abruptly to the correct position:


any ideas welcome.

PS. ignore the error, that's something irrelvant from Gaia or RAM that i havent looked at yet.
 
It's interesting that it looks like it's just the rotation rather than the position that is snapping into position. In the demo scene the Interact ability will set a position/rotation on the button press - does that configuration snap into rotation for you?
 
I don't see a snap with nolan in the demo scene with the button.
If i watch the IKinterpolationTarget then i see it matches the hand movement up to the start of the glitch. it is when the hand stops following the target that it jumps (perhaps this is obvious, but just confirming the hand follows the target up to that glitch).
 
So I can reproduce this with nolan with a simple IK script:

Code:
using UnityEngine;
using Opsive.UltimateCharacterController.Character.Abilities;
using Opsive.Shared.Input;
using Opsive.UltimateCharacterController.Character;

namespace Opsive.UltimateCharacterController.AddOns.Agility {

    [DefaultStartType(AbilityStartType.ButtonDown)]
    [DefaultStopType(AbilityStopType.Manual)]
    
    public class Test : Ability
    {
        private Transform m_IKTarget;
        private CharacterIKBase m_CharacterIK;
        
        public override void Awake() {
            base.Awake();
            m_IKTarget = m_Transform.Find("IKTarget");
            m_CharacterIK = GetComponent<CharacterIKBase>();
        }
        
        protected override void AbilityStarted() {
            base.AbilityStarted();
            m_CharacterIK.SetAbilityIKTarget(m_IKTarget, CharacterIKBase.IKGoal.RightHand, 0.4f);
        }
        
        protected override void AbilityStopped(bool force) {
            base.AbilityStopped(force);
            m_CharacterIK.SetAbilityIKTarget(null, CharacterIKBase.IKGoal.RightHand, 0.4f);
        }
    }
}

Plus add an empty gameobject at localPosition ~(0.3,1.3,0.3) called "IKTarget" with Nolan updating in Update and set the ability to an input.
Note i also used an IK preset setting hand and upper arm weights to 1 and adjustment speeds to 10. The twitch with nolan (best viewed from the side) is most evident when the arm weight is set, because the arm moves more. Setting the arm weight to 0 greatly reduces the twitch, which remains evident on the hand and lower arm.
 
Can you upload a package using Nolan with your scene, ability, and the presets that you are using? This will make it easy for me to reproduce.
 
Thanks. I see some slight movement at the end. I'll take a look at it and let you know what I find out. Just to confirm here's the twitch that I am seeing:

Snap.gif
 
Top