- Home /
Zoom & pan a scene without changing perspective
I'm scratching my head trying to solve this. I have a perspective camera set up that renders a scene. Now I want the player to be able to zoom in on the scene and then pan around without changing the perspective. The effect should be like zooming in on an image and panning it around.
Answer by patrik-org · Mar 31, 2014 at 12:31 PM
Found a solution here http://wiki.unity3d.com/index.php?title=OffsetVanishingPoint "Ken Burns" effect. The effect is not as straight forward as it seems.
Answer by robertbu · Mar 28, 2014 at 09:01 PM
If you don't want to change the field of view of the camera then your choices are:
Physically move the camera in.
Physically move the rest of the scene towards the camera
Increase the size of all the items in the scene.
Answer by CrazyKane · Mar 28, 2014 at 09:05 PM
you'd have to edit the camera's postition when the scroll is taking place like.
var Camera = Camera; var cameraZoom: float:
function Start(){
Camera = GameObject.FindWithTag("MainCamera");
}
function Update(){
if(KeyCode("Scroll or w/e")){
Camera.position.transform.y += cameraZoom;
}
}