Hi All!
I’m working on Deep space rescue 2D space arcade game and wanted to add camera zoom in the beginning of a scene (look at first 3 seconds of video below to get the idea).
It works fine with simple coroutine
public class CameraZoom : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
StartCoroutine(ZoomIn());
}
IEnumerator ZoomIn()
{
Camera.main.orthographicSize = 100;
while (Camera.main.orthographicSize > 5)
{ yield return new WaitForSeconds(0.01f);
Camera.main.orthographicSize -= 1f;
}
}
}
but background image attached now to main camera as a child gameobject with sprite rendered (dark blue rectangle in video) obviously gets zoomed too.
How to change it so that background image always looks the same - fully zoomed in to full screen - regardless of Camera.main.orthographicSize?
Get game on Google play - https://play.google.com/store/apps/details?id=com.Omega486GameStudio.DeepSpaceRescue1