How to set camera in and out to specific object which is clicked?

Hi, I want to make the camera to go to a specific mesh that is clicked from the initial position with an animation and stop there. Suppose the camera is in position A which is (150,20,100) and I want to go to the position B(30,20,30) with an animation onClick on a mesh. How can I do this with React three fiber?

Have you try gsap?

You can use raycast to click the mesh and then activate a camera animation with gsap to do a smoth transition

Yes, I tried GSAP, and it’s working fine. Thanks