I am adding two glTF models to my scene. I am trying to position them separately, but moving one moves the other. I am adding them both like this:
const loader = new THREE.GLTFLoader();
loader.load(duckUrl, gltf => { duck = scene.add(gltf.scene); });
loader.load(boxUrl, gltf => { box = scene.add(gltf.scene); });
And then if I do something like box.rotateX(5)
the duck also rotates. It’s almost like one is a child of the other?
I can fix it by creating an object, and adding one of them to that object, instead of to scene. Is this expected behavior?
Here is a full code example on Glitch: https://glitch.com/edit/#!/threejs-gltf-bug?path=index.html
You can comment out the following line to see the behavior I expect:
//box = object.add(gltf.scene);