Hi
I am trying to move(animate) the glb model when click, how do you change the position of the imported model? when I try to model.position.x, it says model is undefined.
let model;
const makeModel= function(modelPath, px, py, pz){
loader.load(modelPath, (gltf) => {
model = gltf.scene;
scene.add(model);
model.position.x = px;
model.position.y = py;
model.position.z= pz;
});
}
makeModel('/models/model.glb', -1, -0.4, 0);
console.log(model.position.z);