Hello and hope you guys doing well…
im trying to animate camera movement and i tried this because it works well. i wanted to ask if its a good practice or not?
there is variable to control program flow, we call it processStep. when user click, this variable increases each time and by clicking, it moves camera.
Code:
const transferVec = new THREE.Vector3(0,0,500);
const transferVecfinal = new THREE.Vector3(0,0,-100);
useFrame(() => {
if (processStep == 3) {
camera.position.lerp(transferVec,0.01);
}
if (processStep == 4) {
camera.position.lerp(transferVecfinal,0.01);
}
})