2.5d Side Scroller Dynamic Camera Zoom

Hey guys…

I’m creating a side scroller game.
So I search bout camera references and I fount this video:

I’m thinking about ‘how to create a dynamic zoom system’…

Some one have any xp on create it?
I’m thinking about use raycast on X and Y to determine the distance of the player in relation to objects and then calculate the disância camera. Is this is a good practice?

Please, I need advice or direction…
Tks.

Sorry about my poor english.

Well in the video shown, it seems that there are distinct ‘zones’ for the different camera zooms; one easy way to do this is to have several triggers on the path that call ‘Camera.main.fieldOfView’ and change it when the player passes through them. You can use Mathf.Slerp to have that nice tween from one field of view to the next. Hope this helps.