- Home /
Question by
Stefano9528 · Aug 13, 2015 at 10:01 AM ·
sizezoomortographic
Smooth change of camera zoom
Hi everyone. I need to change my camera zoom using its ortographic size smoothly during time. I have levels and at each level I want to change the initial zoom speed and the max zoom speed so during time my zoom speed It will increase. But when I change my max zoom speed into a greater value the zoom speed jump directly into the new maximum value. How can I do that?
ZoomSpeedPerTime = (ZoomSpeed * Time.time);
ZoomSpeedPerTime = Mathf.Clamp (ZoomSpeedPerTime,0f,MaxZoomSpeed);
Camera.main.orthographicSize = Mathf.PingPong(ZoomSpeedPerTime * Time.time,MaxZoom-MinZoom)+MinZoom;
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220611235648im_/https://answers.unity.com/themes/thub/images/avi.jpg)