Why animation group clone is not a deep-copy?

I have an animation group to walk an avatar. I want to make a copy of that animation so I can change the walk slightly and apply it to another avatar. However, when I make this change it changes ALL animation groups.
I used const animCopy = anim.clone("new animation group") thinking it creates a deep-copy but it seems those 2 animation groups are referencing the same data.

You can see in the playground here https://playground.babylonjs.com/#CBGEQX#1171 (open debugging console for output). Changing the value of one animation group affects the other. I’m not sure if I’m doing something wrong or misunderstood how the clone function works. Does anyone know how to do this as a deep-copy?

What if you serialized it and parsed it?

1 Like

That actually works, like 100%! Thank you my clever American friend :slightly_smiling_face:


Love the mood here!

1 Like