I’m new to Three.js but have some experience with javascript. I’m loading a gltf model with an async loader function. This all seems to function correctly. I’m them creating a series of timer events to act upon the loaded object and/or the camera. Again this seems to work well until I come to making a particular child of the loadedObject transparent. I’ve managed a partial success but would like the function to ease the child transparency not just jump the change abruptly This is the function as it stands
loadedObject.traverse((child) => {
if (child.material) {
console.log('Alpha', child.name);
if (child.name === 'Crossbars') {
let newMaterial = child.material.clone();
newMaterial.transparent = true;
newMaterial.opacity = 0.1;
child.material = newMaterial;
}
}
});
But when I add a tween like this: Nothing happens. What am I doing wrong?
loadedObject.traverse((child) => {
if (child.material) {
console.log('Alpha', child.name);
if (child.name === 'Crossbars') {
let newMaterial = child.material.clone();
newMaterial.transparent = true;
child.material = newMaterial;
new TWEEN.Tween(child.material).to({ opacity: 0.1 }, 50000).start();
}
}
});





