Hello,
I got a question about camera, how to make it follow the GLTF object, that is moving through TWEEN addon?
var loader = new THREE.GLTFLoader(); loader.load('Car/car1.gltf', function (gltf) { car1_object = gltf.scene; scene.add(car1_object); car_animation(); //HERE IS WHOLE TWEEN CODE });
and then I have something like this:
function animate(time)
{
requestAnimationFrame(animate);
TWEEN.update(time);if(car1_object)
{
camera.lookAt(car1_object);
}
}
I got no error in console, but my whole screen is black, how can it be repaired?