# How to properly retarget animations?

**URL:** <https://forum.babylonjs.com/t/how-to-properly-retarget-animations/63568>\
**Category:** Questions\
**Created:** [June 1, 2026, 7:36am UTC](https://forum.babylonjs.com/t/how-to-properly-retarget-animations/63568 "2026-06-01T07:36:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fate\_Magician](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/fate_magician/32/50835_2.png) [@Fate\_Magician](https://forum.babylonjs.com/u/Fate_Magician)\
**Post date:** [June 1, 2026, 7:36am UTC](https://forum.babylonjs.com/t/how-to-properly-retarget-animations/63568/1 "2026-06-01T07:36:06Z")

</div>

I have a web app that is like mount and blade. I have some humanoid avatars running around a world map.

The issue I’m facing is animation retargeting. If I load the page and the characters were mid walking, then the animation retargets properly. Presumably because the target avatar was in a rest pose matching the rest pose of the animation avatar.

However, if the character was standing idle, and then begins walking, the animation gets badly retargeted.

I’ve tried to reset the avatar, pre warm the animations and all of that, but nothing seems to give a clear consistent result.

Any advice on the proper way to setup animations so they are retargeted properly? Best practices? Correct methods to use to reset the skinned mesh renderer to its rest pose and retarget or something?

Thanks for the help

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [June 1, 2026, 2:56pm UTC](https://forum.babylonjs.com/t/how-to-properly-retarget-animations/63568/2 "2026-06-01T14:56:41Z")

</div>

cc @Evgeni_Popov (please be patient he is on vacation)

---

<div class="post-metadata">

**Author:** ![Fate\_Magician](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/fate_magician/32/50835_2.png) [@Fate\_Magician](https://forum.babylonjs.com/u/Fate_Magician)\
**Post date:** [June 25, 2026, 6:21am UTC](https://forum.babylonjs.com/t/how-to-properly-retarget-animations/63568/3 "2026-06-25T06:21:40Z")

</div>

Hello? Any insights you could share with me? How to properly go about reseting the avatar so the retarget works properly… Thank you

---

<div class="post-metadata">

**Author:** ![mamta25](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@mamta25](https://forum.babylonjs.com/u/mamta25)\
**Post date:** [July 7, 2026, 11:31am UTC](https://forum.babylonjs.com/t/how-to-properly-retarget-animations/63568/4 "2026-07-07T11:31:24Z")

</div>

It sounds like the character isn’t returning to its original pose before the walk animation starts. I’d make sure both characters use the same T-pose or A-pose, retarget the animations once when the character loads, and then just switch between idle and walk instead of retargeting every time. I’d also check that no other animation or script is affecting the bones during the transition. If you mention which engine you’re using, it’ll be easier for others to suggest a fix.

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [July 7, 2026, 6:11pm UTC](https://forum.babylonjs.com/t/how-to-properly-retarget-animations/63568/5 "2026-07-07T18:11:09Z")

</div>

cc @Evgeni_Popov

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [July 8, 2026, 8:41am UTC](https://forum.babylonjs.com/t/how-to-properly-retarget-animations/63568/6 "2026-07-08T08:41:28Z")

</div>

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](https://forum.babylonjs.com/t/after-anim-retarget-stopping-current-animation-jumps-to-rest-pose/63379), fixed in [PR #18450](https://github.com/BabylonJS/Babylon.js/pull/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:

- [Animation Retargeting documentation](https://doc.babylonjs.com/features/featuresDeepDive/animation/animationRetargeting/)
- [Introducing Animation Retargeting (announcement)](https://forum.babylonjs.com/t/introducing-animation-retargeting/62547)

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.

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [July 8, 2026, 11:02pm UTC](https://forum.babylonjs.com/t/how-to-properly-retarget-animations/63568/7 "2026-07-08T23:02:27Z")

</div>

Thanks a ton @Evgeni_Popov !!!
