In my project, I have used functions to animate the ArcCamera to zoom into a mesh when clicked. I was looking for a cinematic way to animate the camera from a top down view into a particular object of the scene. I found this code [https://www.babylonjs-playground.com/#3U658N#13] and modified it.
It works OK but it has issues when the mesh is clicked for the first time and when the page is refreshed. The camera appears to do an unnecessary ‘backflip’. A simplification of the issue can be found in:
First, refresh the page, then run the code and click the sphere. The first time, the camera circles the scene before zooming into the sphere (which does not look good and is undesirable for our project). If one manually zooms out and clicks on the mesh, the animation behaves reasonably and no backflips are done.
I was wondering if anyone had an idea of what the issue could be and how to solve it. Alternatively, another suggestion on how to cinematically zoom into an object would be appreciated. Any of these would be very helpful.