I am using Cinemachine 2D with a Confiner but if my screen size grows (Maximize on Play or Build) its not showing the full content like its zooming in so i found a script for fix that. It fixed a bit but its not fully okay, its okay in width but its not okay in height there is a huge empty place down my ground and I dont know how to fix it.
Maximize on Play:
Build:
Script:
public class CameraResize : MonoBehaviour
{
public int fullWidthUnits;
void Start () {
float ratio = (float)Screen.height / (float)Screen.width;
GetComponent
().m_Lens.OrthographicSize = (float)fullWidthUnits * ratio / 2.0f;
}
}