I wish to make a zoom effect similar to sniper scope/telescope. The basic way I found on google is to adjust FOV to low number. The issue I hit with this method is that it does not go lower than 1. That means the zoom distance is quite limited for anything long range.
What to do here?
Just adjusting the actual camera position is no go because if there’s something in front(behind after zooming) it won’t be visible. Using a raycast to move camera back if it hits something creates a really weird and unnatural effect for this purpose.
Currently the best way I can imagine is to use fov as far as possible and then move actual camera for further zoom but it still creates the above mentioned issue.
What I would like to know is if there is a way to implement zoom that could go further than what 1 FOV does while also keeping it more or less natural looking.
Well the first and most obvious question is - do you really need zoom levels that intense? 1 FOV would be nauseating for most players, and let you see a target over a 1000 units (1 kilometre) away as if they were standing right next to you, which seems unreasonably accurate for any conventional optics.
If you really do need those kind of zoom levels, then you’re going to have to adjust your scale. Instead of 1 unit = 1 metre, make it 1 unit = 10 metres.
This is how it looks like at 1 FOV, the character is ~250m away. Not even close to 1km. I am working with default 1 unit = 1m scale. If this was at 1km distance, that would be perfect. But at only a quarter a bit more is desired.
That sounds like a decent solution but would require rescaling everything. Though if there is no better way, this will be it then.
why not have two cameras? one attached to the other. the second being the “zoom camera”. because it’s attached to the first it should always be in the correct position, it’s just “x” units ahead of it.
then do something similar like:
on zoom button
do animation of eye moving to scope
adjust FOV of first camera to simulate a zoom in for half a second
switch view to second camera
If there is something really close to view it won’t show up when zoomed in. Say a bird flies past your face, but if you’re zoomed in, the camera won’t see that bird since it’s closer than X.
I’m surprised FOV doesn’t go lower then one, even if set by script?
Anyway you next best bet is to manually zoom. Set the camera output to a render texture. Then put that texture on a mesh or sprite. Then make the mesh bigger then the screen size.