Closed yaustar closed 2 years ago
Looks like something in the terser() build step is causing this issue but not sure what 🤔
On the minified build, it looks like that the rootBone is not set on the clones which is VERY weird
Found the issue:
https://github.com/playcanvas/engine/blob/master/src/framework/components/anim/component.js#L151
On a minified build, the constructor.name
is set to t
because of the minification process therefore the _rootbone = value
code path is not executed.
Thread: https://forum.playcanvas.com/t/bug-cloning-instantiating-a-template-with-anim-component-is-broken/22576
Test project: https://playcanvas.com/editor/scene/1258298
Animates correctly: https://launch.playcanvas.com/1258298?debug=true&use_local_engine=https://code.playcanvas.com/playcanvas-1.47.2.js Does not animate: https://launch.playcanvas.com/1258298?debug=true&use_local_engine=https://code.playcanvas.com/playcanvas-1.47.2.min.js
Looks like there is an issue between the different build versions of the engine 🤔
However, it works fine in the Bitmoji Loader project: 1.47.2: https://launch.playcanvas.com/995061?debug=true&use_local_engine=https://code.playcanvas.com/playcanvas-1.47.2.js
1.47.2.min: https://launch.playcanvas.com/995061?debug=true&use_local_engine=https://code.playcanvas.com/playcanvas-1.47.2.min.js
I think the difference here is how the Anim Component is setup with the root bone set on a different entity that the component is but I'm not sure if this is the cause of the issue: