AssetsContainer.instantiateModelsToScene() with first parameter changes name of animationgroups

Hey guys,
In 4.2.0 version i had such code.
const entries = assetsContainer.instantiateModelsToScene(mesh => field.creature.type);

In 5.7.0 version behaviour of instantiateModelsToScene is changed. Now entries variable will contain animationGroups with changed names. Is it intentional? I used name to get correct animation and start/stop it. Now all names of all animationGroups are the same %field.creature.type%

For me it looks like a bug
Could you please check it?

It is intentional as before they would have all the same name making it impossible to differentiate them.

The code works like this:

this.animationGroups.forEach((o) => {
            if (options && options.predicate && !options.predicate(o)) {

            const clone = o.clone(nameFunction ? nameFunction( : "Clone of " +, (oldTarget) => {
                const newTarget = storeMap[convertionMap[oldTarget.uniqueId]];

                return newTarget || oldTarget;


So in your case you could use a special mapping ?

Understood where is my problem. I used wrong nameFunction which is just set const name. Now because of that function all names of all animationGroups became the same. It worked before because previously animationGroups names wasn’t updated.

Thanks you.