AnimationGroup target

Hello, What is the best way to define a target for animation? Here is an example (built on top from another one from the community): https://playground.babylonjs.com/#AJA5J6#49

It looks like the target is the last one that has been loaded.

One possibility is to keep them all in memory: https://playground.babylonjs.com/#AJA5J6#50

Not sure this is the best way to do.

Sorry but I’m not sure of what is the question :smiley:

Sorry, my question wasn’t clear. I load the same model, including animations, multiple times (copies). The scene will then contain the animation groups, but the target is from the last loaded one.

What is the correct approach to have animation groups independent for each model loaded? In https://playground.babylonjs.com/#AJA5J6#50 I fundamentally keep the copy for each.

Is it not just link to where you define the array ???

https://playground.babylonjs.com/#AJA5J6#52

Right, I thought there was an alternative way. Thx

Note that you don’t have to load the asset multiple times. You can load the model into an asset container and then instantiate multiple copies of them. See this.

1 Like