Hi, quite new to THREE.js, I want to bring in models, clone, modify positions & materials, and reference these objects outside to function scope for each import.
// Model Loading
let device01 = null
let device02 = null
gltfLoader.load('device01.gltf',(deviceA) =>
{
device01 = deviceA
device01.scene.position.set(-2,0,0)
scene.add(device01.scene)
checkLoaded() })
gltfLoader.load('device01.gltf',(deviceB) =>
{ device02 = deviceB
device02.scene.position.set(0,0.5,0)
scene.add(device02.scene)
checkLoaded() })
const checkLoaded = () =>
{ if(device01 && device02)
{ console.log('dev1:', device01)
console.log('dev2:',device02) } }
const tick = () => {
const elapsedTime = clock.getElapsedTime()
device01.rotation.y = 0.4 * elapsedTime *console error here**
Any help appreciated!