When I import a gltf object, it seems to render in the browser but I am unable to access it using an outside variable. What could be causing this issue?
let loadedModel;
gltfLoader.load('./assets/javaLogo.gltf', function(gltf){
loadedModel = gltf.scene;
loadedModel.scale.set(44,44,44);
scene.add(loadedModel);
loadedModel.position.x = 44;
loadedModel.position.y = -12;
});
console.log(loadedModel);// This prints 'undefined'