Cloned objects don't seem to have the same enabled state as the original object

If a disabled object (i.e. setEnabled(false)) is cloned, its children seem to be cloned with the wrong enabled state. Subsequently calling setEnabled(true) on the original object will show the object and all of its children, but calling setEnabled(true) on the cloned object will not enable the children.

Demo: Babylon.js Playground
Expected result: two models would be shown, both the original and the clone.
Actual result: only the original model is shown.

Some visibility info is logged to the console in the demo.

Hello and welcome to the Babylon community! I’ll take a look at this.

1 Like

Thanks for the report, a PR for the fix is up! Use only the mesh’s enabled state, not its parent’s, when cloning. by carolhmj · Pull Request #12766 · BabylonJS/Babylon.js (github.com)

1 Like