Hi! What you’re describing is almost certainly retargeting being run while an animation is already playing on the avatar.
Under the hood, AnimatorAvatar.retargetAnimationGroup returns each skeleton to its rest pose to compute the bone offsets it needs (returnToRest() internally, plus the root/ground fixups). That’s why it looks fine when you load with the character mid-walk (the skeleton is basically at rest at that moment) but goes wrong when you retarget at the idle→walk transition — the active idle pose gets disturbed.
Two recommendations:
1. Make sure you’re on 9.7.0 or newer. This was a real bug — retargeting clobbered any animation already playing on the avatar (see After Anim Retarget Stopping Current Animation Jumps to Rest Pose, fixed in PR #18450). If you’re on an older build, please upgrade first and re-test.
2. Retarget once, up front — not on every state switch. Retargeting is a one-time setup step that produces a reusable, already-retargeted AnimationGroup. Do it at load time for every clip (idle, walk, run, …), cache the resulting groups, and then just start() / blend between those cached groups when the character changes state. You should never call retargetAnimationGroup at the moment you begin walking — that’s what makes the result depend on the current pose. This also matches @mamta25’s suggestion above.
Docs and background:
To help pin it down, could you share: (a) your Babylon.js version, (b) whether you’re using AnimatorAvatar or a custom retargeting approach, and ideally (c) a small Playground repro? With those I can tell you exactly where it’s going wrong.